public class W3CDateFormat extends SimpleDateFormat
Formats and parses dates in the six defined W3C date time formats. These formats are described in "Date and Time Formats", http://www.w3.org/TR/NOTE-datetime.
The formats are:
This class allows you to either specify which format pattern to use, or (by default) to automatically guess which pattern to use (AUTO mode). When parsing in AUTO mode, we'll try parsing using each pattern until we find one that works. When formatting in AUTO mode, we'll use this algorithm:
DateFormat.setTimeZone(TimeZone) method.
| Modifier and Type | Class and Description |
|---|---|
static class |
W3CDateFormat
The six patterns defined by W3C, plus
W3CDateFormat configuration
|
DateFormat.Field | Modifier and Type | Field and Description |
|---|---|
static TimeZone |
ZULU
The GMT ("zulu") time zone, for your convenience
|
AM_PM_FIELD, calendar, 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, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| Constructor and Description |
|---|
W3CDateFormat()
Build a formatter in AUTO mode
|
W3CDateFormat(W3CDateFormat
Build a formatter using the specified Pattern, or AUTO mode
|
| Modifier and Type | Method and Description |
|---|---|
StringBuffer |
format(Date
This is what you override when you extend DateFormat; use
DateFormat instead
|
Date |
parse(String
This is what you override when you extend DateFormat; use
DateFormat instead
|
applyLocalizedPattern, applyPattern, clone, equals, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPatternformat, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZoneformat, parseObjectpublic static final TimeZoneZULU
public W3CDateFormat()
public W3CDateFormat(W3CDateFormat.Pattern pattern)
public StringBufferformat(Date date, StringBuffer toAppendTo, FieldPosition pos)
DateFormat.format(Date) instead
public Dateparse(String text, ParsePosition pos)
DateFormat.parse(String) instead