public class StdDateFormat
extends java.text.DateFormat
DateFormat implementation used by standard Date
serializers and deserializers. For serialization defaults to using
an ISO-8601 compliant format (format String "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
and for deserialization, both ISO-8601 and RFC-1123.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
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 StdDateFormat |
instance
A singleton instance can be used for cloning purposes, as a blueprint of sorts.
|
AM_PM_FIELD, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| Constructor and Description |
|---|
StdDateFormat() |
StdDateFormat(java.util.TimeZone tz,
java.util.Locale loc)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
StdDateFormat |
clone() |
boolean |
equals(java.lang.Object o) |
java.lang.StringBuffer |
format(java.util.Date date,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition fieldPosition) |
static java.util.TimeZone |
getDefaultTimeZone() |
static java.text.DateFormat |
getISO8601Format(java.util.TimeZone tz)
Deprecated.
Since 2.4; use variant that takes Locale
|
static java.text.DateFormat |
getISO8601Format(java.util.TimeZone tz,
java.util.Locale loc)
Method for getting a non-shared DateFormat instance
that uses specified timezone and can handle simple ISO-8601
compliant date format.
|
static java.text.DateFormat |
getRFC1123Format(java.util.TimeZone tz)
Deprecated.
Since 2.4; use variant that takes Locale
|
static java.text.DateFormat |
getRFC1123Format(java.util.TimeZone tz,
java.util.Locale loc)
Method for getting a non-shared DateFormat instance
that uses specific timezone and can handle RFC-1123
compliant date format.
|
java.util.TimeZone |
getTimeZone() |
int |
hashCode() |
boolean |
isLenient() |
java.util.Date |
parse(java.lang.String dateStr) |
java.util.Date |
parse(java.lang.String dateStr,
java.text.ParsePosition pos) |
void |
setLenient(boolean enabled)
Need to override since we need to keep track of leniency locally,
and not via underlying
Calendar instance like base class
does. |
void |
setTimeZone(java.util.TimeZone tz) |
java.lang.String |
toString() |
StdDateFormat |
withLocale(java.util.Locale loc) |
StdDateFormat |
withTimeZone(java.util.TimeZone tz)
Method used for creating a new instance with specified timezone;
if no timezone specified, defaults to the default timezone (UTC).
|
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, parseObject, setCalendar, setNumberFormatpublic static final java.lang.String DATE_FORMAT_STR_ISO8601
public static final StdDateFormat instance
public StdDateFormat()
@Deprecated
public StdDateFormat(java.util.TimeZone tz,
java.util.Locale loc)
public static java.util.TimeZone getDefaultTimeZone()
public StdDateFormat withTimeZone(java.util.TimeZone tz)
public StdDateFormat withLocale(java.util.Locale loc)
public StdDateFormat clone()
clone in class java.text.DateFormat@Deprecated public static java.text.DateFormat getISO8601Format(java.util.TimeZone tz)
public static java.text.DateFormat getISO8601Format(java.util.TimeZone tz,
java.util.Locale loc)
public static java.text.DateFormat getRFC1123Format(java.util.TimeZone tz,
java.util.Locale loc)
@Deprecated public static java.text.DateFormat getRFC1123Format(java.util.TimeZone tz)
public java.util.TimeZone getTimeZone()
getTimeZone in class java.text.DateFormatpublic void setTimeZone(java.util.TimeZone tz)
setTimeZone in class java.text.DateFormatpublic void setLenient(boolean enabled)
Calendar instance like base class
does.setLenient in class java.text.DateFormatpublic boolean isLenient()
isLenient in class java.text.DateFormatpublic java.util.Date parse(java.lang.String dateStr)
throws java.text.ParseException
parse in class java.text.DateFormatjava.text.ParseExceptionpublic java.util.Date parse(java.lang.String dateStr,
java.text.ParsePosition pos)
parse in class java.text.DateFormatpublic java.lang.StringBuffer format(java.util.Date date,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition fieldPosition)
format in class java.text.DateFormatpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.text.DateFormatpublic int hashCode()
hashCode in class java.text.DateFormat"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"