@GwtIncompatible public final class DefaultDateFormat extends Object implements JacksonContext.DateFormat
DefaultDateFormat class.
| Modifier and Type | Field and Description |
|---|---|
static DateTimeFormatter |
DATE_FORMAT_STR_ISO8601
Defines a commonly used date format that conforms
to ISO-8601 date formatting standard, when it includes basic undecorated
timezone definition
|
static DateTimeFormatter |
DATE_FORMAT_STR_ISO8601_Z
Same as 'regular' 8601, but handles 'Z' as an alias for "+0000"
(or "GMT")
|
static DateTimeFormatter |
DATE_FORMAT_STR_PLAIN
ISO-8601 with just the Date part, no time
|
static DateTimeFormatter |
DATE_FORMAT_STR_RFC1123
This constant defines the date format specified by
RFC 1123 / RFC 822.
|
static ZoneId |
UTC_TIMEZONE
UTC TimeZone
|
| Constructor and Description |
|---|
DefaultDateFormat()
Constructor for DefaultDateFormat.
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(Date date)
Format a date using
DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONE |
String |
format(DateTimeFormatter format,
Date date)
Format a date using the
DateTimeFormatter given in parameter and UTC_TIMEZONE. |
String |
format(DateTimeFormatter format,
ZoneId timeZone,
Date date)
Format a date using the
DateTimeFormatter and ZoneId given in
parameters |
String |
format(JsonSerializerParameters params,
Date date)
Format a date using
JsonSerializerParameters or default values : DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONE |
String |
format(ZoneId timeZone,
Date date)
Format a date using
DATE_FORMAT_STR_ISO8601 and ZoneId given in parameter |
<D extends Date> |
makeDateKeyParser() |
Date |
parse(boolean useBrowserTimezone,
String pattern,
Boolean hasTz,
String date)
Parse a date using the pattern given in parameter or
DATE_FORMAT_STR_ISO8601 and the browser timezone. |
Date |
parse(DateTimeFormatter format,
String date)
Parse a date using the
DateTimeFormatter given in
parameter and the browser timezone. |
Date |
parse(SimpleDateFormat format,
String date)
Parse a date using the
DateTimeFormatter given in
parameter and the browser timezone. |
Date |
parse(String date)
Parse a date using
DATE_FORMAT_STR_ISO8601 and the browser timezone. |
public static final DateTimeFormatter DATE_FORMAT_STR_ISO8601
public static final DateTimeFormatter DATE_FORMAT_STR_ISO8601_Z
public static final DateTimeFormatter DATE_FORMAT_STR_PLAIN
public static final DateTimeFormatter DATE_FORMAT_STR_RFC1123
public static final ZoneId UTC_TIMEZONE
public String format(Date date)
DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONEformat in interface JacksonContext.DateFormatpublic String format(JsonSerializerParameters params, Date date)
JsonSerializerParameters or default values : DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONEformat in interface JacksonContext.DateFormatpublic String format(DateTimeFormatter format, Date date)
DateTimeFormatter given in parameter and UTC_TIMEZONE.public String format(ZoneId timeZone, Date date)
DATE_FORMAT_STR_ISO8601 and ZoneId given in parameterpublic String format(DateTimeFormatter format, ZoneId timeZone, Date date)
DateTimeFormatter and ZoneId given in
parametersformat - format to usetimeZone - timezone to usedate - date to formatpublic Date parse(String date)
DATE_FORMAT_STR_ISO8601 and the browser timezone.date - date to parsepublic Date parse(boolean useBrowserTimezone, String pattern, Boolean hasTz, String date)
DATE_FORMAT_STR_ISO8601 and the browser timezone.parse in interface JacksonContext.DateFormatpublic Date parse(DateTimeFormatter format, String date)
DateTimeFormatter given in
parameter and the browser timezone.format - format to usedate - date to parsepublic Date parse(SimpleDateFormat format, String date)
DateTimeFormatter given in
parameter and the browser timezone.format - format to usedate - date to parsepublic <D extends Date> DateKeyParser<D> makeDateKeyParser()
makeDateKeyParser in interface JacksonContext.DateFormatCopyright © 2019. All rights reserved.