Package org.opencastproject.util
Class DateTimeSupport
java.lang.Object
org.opencastproject.util.DateTimeSupport
Utility class used to convert from and to
UTC time.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classJAXB adapter that formats dates in UTC format YYYY-MM-DD'T'hh:mm:ss'Z' up to second, e.g. 1970-01-01T00:00:00Z -
Method Summary
Modifier and TypeMethodDescriptionstatic longThis methods reads a utc date string and returns it's unix time equivalent in milliseconds.static StringhumanReadableTime(long seconds) Converts seconds to a human readable time string.static StringtoUTC(long time) Returns the date and time in milliseconds as a utc formatted string.
-
Method Details
-
fromUTC
This methods reads a utc date string and returns it's unix time equivalent in milliseconds. i.e. yyyy-MM-ddTHH:mm:ssZ e.g. 2014-09-27T16:25Z- Parameters:
s- the utc string- Returns:
- the date/time in milliseconds
- Throws:
IllegalStateExceptionParseException- if the date string is malformed
-
toUTC
Returns the date and time in milliseconds as a utc formatted string.- Parameters:
time- the utc time string- Returns:
- the local time
-
humanReadableTime
Converts seconds to a human readable time string.
-