Provides a set of methods for parsing/formatting ISO 8601 dates. https://en.wikipedia.org/wiki/ISO_8601
Type | Name and description |
---|---|
static ThreadLocal<SimpleDateFormat> |
DATE_TIME_FORMAT |
static Pattern |
GMT_MILLIS |
static Pattern |
GMT_SECONDS |
static Pattern |
LOCAL_DATE |
static ThreadLocal<SimpleDateFormat> |
LOCAL_DATE_FORMAT |
static Pattern |
TZ_LESS |
static Pattern |
TZ_LESS_HH_MM |
Type Params | Return Type | Name and description |
---|---|---|
|
static String |
dateToString(Date date, String format = 'MM/dd/yyyy hh:mm:ss') Converts a Date into a string using a specified format. |
|
static String |
format(Date date) Returns a string representation of a given date in the 'yyyy-MM-dd'T'HH:mm:ss.SSSZ' format. |
|
static String |
format(LocalDate date, String format = null) |
|
static Date |
parse(String date) Parse date sent by client (mostly JSON). |
|
static LocalDate |
parseLocalDate(String date) |
|
static LocalDateTime |
parseLocalDateTime(String date) |
Converts a Date into a string using a specified format.
date
- a date to covertformat
- a date format, by default "MM/dd/yyyy hh:mm:ss"Returns a string representation of a given date in the 'yyyy-MM-dd'T'HH:mm:ss.SSSZ' format. UTC ISO standard
date
- a date to convert into a stringParse date sent by client (mostly JSON). Expected formats: 2000-03-30, 2000-03-30T22:11:22.123Z , 2000-03-30T22:00:00Z or yyyy-MM-dd'T'HH:mm:ss Assumes all timeZones are UTC //see https://stackoverflow.com/questions/10286204/the-right-json-date-format
date
- formatted date