@ThreadSafe @LevelUpApi(contract=INTERNAL) public final class IsoDateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static TimeZone |
getTimeZoneUtc()
Gets a new instance of
TimeZone representing UTC. |
static Date |
parseIsoDatetime(String datetime)
Parses an ISO 8601 timezone-formatted string into a
Date in UTC. |
static Date |
parseIsoDatetime(String datetime,
TimeZone timeZone)
|
static String |
toIsoDatetime(Date date)
Converts a
Date to a ISO 8601 timezone-formatted string in UTC. |
static String |
toIsoDatetime(Date date,
TimeZone timeZone)
|
public static TimeZone getTimeZoneUtc()
TimeZone
representing UTC.TimeZone
representing UTC.public static Date parseIsoDatetime(String datetime) throws ParseException
Date
in UTC.datetime
- An ISO 8601 formatted datetime with timezone.Date
relative to the given TimeZone
.ParseException
- if there was a problem parsing the date.public static Date parseIsoDatetime(String datetime, TimeZone timeZone) throws ParseException
datetime
- An ISO 8601 formatted datetime with timezone.timeZone
- The relative TimeZone
.Date
relative to the given TimeZone
.ParseException
- if there was a problem parsing the date.public static String toIsoDatetime(Date date)
Date
to a ISO 8601 timezone-formatted string in UTC.date
- The date to convert.TimeZone
.