Package org.vast.util
Class DateTimeFormat
java.lang.Object
org.vast.util.DateTimeFormat
Formatter for Date and Time quantities. Contains helper routines to convert to and from ISO8601
- Since:
- Nov 29, 2005
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatIso
(double julianTime, int timeZone) Formats a julian time to ISO8601 standardformatIsoPeriod
(double periodInSeconds) Formats a period expressed in seconds to ISO8601 time period standardformatIsoPeriod
(double periodInSeconds, char biggestUnit) Formats a period in seconds to ISO8601 period standard starting with the given unit and going down as much as requireddouble
Parses an ISO8601 data/time string and return the corresponding unix timedouble
parseIsoPeriod
(String iso8601) Parses an ISO8601 period string and return the length of the period.
-
Field Details
-
ISO_DATE_OR_TIME_FORMAT
-
-
Constructor Details
-
DateTimeFormat
public DateTimeFormat()
-
-
Method Details
-
parseIsoPeriod
Parses an ISO8601 period string and return the length of the period.- Parameters:
iso8601
-- Returns:
- length of period in seconds
- Throws:
ParseException
-
parseIso
Parses an ISO8601 data/time string and return the corresponding unix time- Parameters:
iso8601
-- Returns:
- unix/julian time stamp
- Throws:
ParseException
-
formatIsoPeriod
Formats a period expressed in seconds to ISO8601 time period standard- Parameters:
periodInSeconds
-- Returns:
- ISO string representing the period
-
formatIsoPeriod
Formats a period in seconds to ISO8601 period standard starting with the given unit and going down as much as required- Parameters:
periodInSeconds
-biggestUnit
- largest unit to use in encoded string (one of Y, M, D, H, m, S)- Returns:
- ISO string representing the period
-
formatIso
Formats a julian time to ISO8601 standard- Parameters:
julianTime
- Julian time with 1970 basetimeZone
- time zone to use in the ISO string- Returns:
- ISO string representing the date/time
-