public final class DateTimeSupport extends Object
UTC time.| Modifier and Type | Class and Description |
|---|---|
static class |
DateTimeSupport.UtcTimestampAdapter
JAXB adapter that formats dates in UTC format YYYY-MM-DD'T'hh:mm:ss'Z' up to second,
e.g.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
fromUTC(String s)
This methods reads a utc date string and returns it's unix time equivalent in milliseconds.
|
static long |
fromUTCNoSeconds(String s)
This methods reads a utc date string without seconds and returns it's unix time equivalent in milliseconds.
|
static org.joda.time.DateTime |
toNextWeekDay(org.joda.time.DateTime time,
int weekDay)
Forward to the next week day.
|
static String |
toUTC(long time)
Returns the date and time in milliseconds as a utc formatted string.
|
public static long fromUTC(String s) throws IllegalStateException, ParseException
s - the utc stringIllegalStateExceptionParseException - if the date string is malformedpublic static long fromUTCNoSeconds(String s) throws IllegalStateException, ParseException
s - the utc stringIllegalStateExceptionParseException - if the date string is malformedpublic static String toUTC(long time)
time - the utc time stringpublic static org.joda.time.DateTime toNextWeekDay(org.joda.time.DateTime time,
int weekDay)
If it's Monday forwarding to Tuesday will add 1 day. If it's Friday forwarding to Thursday will go to next week's
Thursday which is adding 6 days. Forward to Monday if on Monday simply returns time.
weekDay - like described in DateTimeConstantsCopyright © 2009–2021 Opencast Project. All rights reserved.