Class TimestampFormatter
java.lang.Object
org.heigit.ohsome.ohsomeapi.utils.TimestampFormatter
A helper class to transform timestamps between string, date and long.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConverts a date to the formatyyyy-MM-dd
.static TimestampFormatter
Get a standard TimestampFormatter.isoDateTime
(long timestamp) Converts a unix-timestamp (oshdb-timestamp) to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
(OSM-Timestamp).isoDateTime
(Date date) Converts a date to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
.isoDateTime
(org.heigit.ohsome.oshdb.OSHDBTimestamp date) Converts a date to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
.
-
Constructor Details
-
TimestampFormatter
public TimestampFormatter()
-
-
Method Details
-
getInstance
Get a standard TimestampFormatter.- Returns:
- a timestamp formatter object
-
date
Converts a date to the formatyyyy-MM-dd
.- Parameters:
date
- the date to be printed- Returns:
- the formatted date string
-
isoDateTime
Converts a date to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
.- Parameters:
date
- the date to be printed- Returns:
- the formatted date string
-
isoDateTime
Converts a unix-timestamp (oshdb-timestamp) to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
(OSM-Timestamp).- Parameters:
timestamp
- the timestamp to be printed- Returns:
- the formatted date string
-
isoDateTime
Converts a date to the formatyyyy-MM-dd'T'HH:mm:ss'Z'
.- Parameters:
date
- the date to be printed- Returns:
- the formatted date string
-