@AlfrescoPublicApi public class ISO8601DateFormat extends Object
sYYYY-MM-DDThh:mm:ss.sssTZDwhere:
Modifier and Type | Field and Description |
---|---|
static TimeZone |
UTC_TIMEZONE |
Constructor and Description |
---|
ISO8601DateFormat() |
Modifier and Type | Method and Description |
---|---|
static String |
format(Date isoDate)
Format date into ISO format (UCT0 / Zulu)
|
static String |
formatToZulu(String isoDate)
Normalise isoDate time to Zulu(UTC0) time-zone, removing any UTC offset.
|
static Calendar |
getCalendar()
Get a calendar object from cache for the system default timezone.
|
static Calendar |
getCalendar(TimeZone timezone)
Get a calendar object from cache.
|
static boolean |
isTimeComponentDefined(String isoDate)
Checks whether or not the given ISO8601-formatted date-string contains a time-component
instead of only the actual date.
|
static Date |
parse(String isoDate)
Parse date from ISO formatted string.
|
static Date |
parse(String isoDate,
TimeZone timezone)
Parse date from ISO formatted string, with an
explicit timezone specified
|
static Date |
parseDayOnly(String isoDate,
TimeZone timezone)
Parses the given ISO8601-formatted date-string, not taking into account the time-component.
|
static Date |
parseInternal(String isoDate,
TimeZone timezone)
Parse date from ISO formatted string, either in the specified
TimeZone, or with TimeZone information taken from the date
|
public static final TimeZone UTC_TIMEZONE
public static Calendar getCalendar(TimeZone timezone)
timezone
- timezone object to indicate the timezone to be used by the returned calendar objectpublic static Calendar getCalendar()
public static String format(Date isoDate)
isoDate
- the date to formatpublic static String formatToZulu(String isoDate)
isoDate
- public static Date parse(String isoDate)
isoDate
- ISO string to parseAlfrescoRuntimeException
- if the parse failedpublic static Date parse(String isoDate, TimeZone timezone)
isoDate
- ISO string to parsetimezone
- The TimeZone the date is inAlfrescoRuntimeException
- if the parse failedpublic static Date parseInternal(String isoDate, TimeZone timezone)
isoDate
- ISO string to parsetimezone
- The time zone, null means default time zoneAlfrescoRuntimeException
- if the parse failedpublic static boolean isTimeComponentDefined(String isoDate)
isoDate
- public static Date parseDayOnly(String isoDate, TimeZone timezone)
isoDate
- the day (formatted sYYYY-MM-DD) or a full date (sYYYY-MM-DDThh:mm:ss.sssTZD)timezone
- the timezone to useAlfrescoRuntimeException
- if the parsing failed.Copyright © 2005–2018 Alfresco Software. All rights reserved.