public final class DateFormat extends Object
DateFormat class.
| Modifier and Type | Field and Description |
|---|---|
static com.google.gwt.i18n.client.DateTimeFormat |
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 com.google.gwt.i18n.client.DateTimeFormat |
DATE_FORMAT_STR_ISO8601_Z
Same as 'regular' 8601, but handles 'Z' as an alias for "+0000"
(or "GMT")
|
static com.google.gwt.i18n.client.DateTimeFormat |
DATE_FORMAT_STR_PLAIN
ISO-8601 with just the Date part, no time
|
static com.google.gwt.i18n.client.DateTimeFormat |
DATE_FORMAT_STR_RFC1123
This constant defines the date format specified by
RFC 1123 / RFC 822.
|
static com.google.gwt.i18n.client.TimeZone |
UTC_TIMEZONE
UTC TimeZone
|
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Date date)
Format a date using
DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONE |
static String |
format(com.google.gwt.i18n.client.DateTimeFormat format,
Date date)
Format a date using the
DateTimeFormat given in parameter and UTC_TIMEZONE. |
static String |
format(com.google.gwt.i18n.client.DateTimeFormat format,
com.google.gwt.i18n.client.TimeZone timeZone,
Date date)
Format a date using the
DateTimeFormat and TimeZone given in
parameters |
static String |
format(JsonSerializerParameters params,
Date date)
Format a date using
JsonSerializerParameters or default values : DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONE |
static String |
format(com.google.gwt.i18n.client.TimeZone timeZone,
Date date)
Format a date using
DATE_FORMAT_STR_ISO8601 and TimeZone given in parameter |
static 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. |
static Date |
parse(com.google.gwt.i18n.client.DateTimeFormat format,
String date)
Parse a date using the
DateTimeFormat given in
parameter and the browser timezone. |
static Date |
parse(String date)
Parse a date using
DATE_FORMAT_STR_ISO8601 and the browser timezone. |
public static final com.google.gwt.i18n.client.DateTimeFormat DATE_FORMAT_STR_ISO8601
public static final com.google.gwt.i18n.client.DateTimeFormat DATE_FORMAT_STR_ISO8601_Z
public static final com.google.gwt.i18n.client.DateTimeFormat DATE_FORMAT_STR_PLAIN
public static final com.google.gwt.i18n.client.DateTimeFormat DATE_FORMAT_STR_RFC1123
public static final com.google.gwt.i18n.client.TimeZone UTC_TIMEZONE
public static String format(Date date)
DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONEdate - date to formatpublic static String format(JsonSerializerParameters params, Date date)
JsonSerializerParameters or default values : DATE_FORMAT_STR_ISO8601 and UTC_TIMEZONEdate - date to formatparams - a JsonSerializerParameters object.public static String format(com.google.gwt.i18n.client.DateTimeFormat format, Date date)
DateTimeFormat given in parameter and UTC_TIMEZONE.format - format to usedate - date to formatpublic static String format(com.google.gwt.i18n.client.TimeZone timeZone, Date date)
DATE_FORMAT_STR_ISO8601 and TimeZone given in parametertimeZone - timezone to usedate - date to formatpublic static String format(com.google.gwt.i18n.client.DateTimeFormat format, com.google.gwt.i18n.client.TimeZone timeZone, Date date)
DateTimeFormat and TimeZone given in
parametersformat - format to usetimeZone - timezone to usedate - date to formatpublic static Date parse(String date)
DATE_FORMAT_STR_ISO8601 and the browser timezone.date - date to parsepublic static Date parse(boolean useBrowserTimezone, String pattern, Boolean hasTz, String date)
DATE_FORMAT_STR_ISO8601 and the browser timezone.useBrowserTimezone - when the date doesn't include timezone information use browser default or UTC.pattern - pattern to use. If null, DATE_FORMAT_STR_ISO8601 will be used.hasTz - whether the pattern includes timezone information. when null the pattern will be parsed to search it.date - date to parseCopyright © 2017. All Rights Reserved.