|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.text.Format
java.text.DateFormat
java.text.SimpleDateFormat
com.redfin.sitemapgenerator.W3CDateFormat
public class W3CDateFormat
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.
| Nested Class Summary | |
|---|---|
static class |
W3CDateFormat.Pattern
The six patterns defined by W3C, plus W3CDateFormat.Pattern.AUTO configuration |
| Nested classes/interfaces inherited from class java.text.DateFormat |
|---|
java.text.DateFormat.Field |
| Field Summary | |
|---|---|
static java.util.TimeZone |
ZULU
The GMT ("zulu") time zone, for your convenience |
| Fields inherited from class java.text.DateFormat |
|---|
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 Summary | |
|---|---|
W3CDateFormat()
Build a formatter in AUTO mode |
|
W3CDateFormat(W3CDateFormat.Pattern pattern)
Build a formatter using the specified Pattern, or AUTO mode |
|
| Method Summary | |
|---|---|
java.lang.StringBuffer |
format(java.util.Date date,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
This is what you override when you extend DateFormat; use DateFormat.format(Date) instead |
java.util.Date |
parse(java.lang.String text,
java.text.ParsePosition pos)
This is what you override when you extend DateFormat; use DateFormat.parse(String) instead |
| Methods inherited from class java.text.SimpleDateFormat |
|---|
applyLocalizedPattern, applyPattern, clone, equals, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern |
| Methods inherited from class java.text.DateFormat |
|---|
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone |
| Methods inherited from class java.text.Format |
|---|
format, parseObject |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.TimeZone ZULU
| Constructor Detail |
|---|
public W3CDateFormat()
public W3CDateFormat(W3CDateFormat.Pattern pattern)
| Method Detail |
|---|
public java.lang.StringBuffer format(java.util.Date date,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
DateFormat.format(Date) instead
format in class java.text.SimpleDateFormat
public java.util.Date parse(java.lang.String text,
java.text.ParsePosition pos)
DateFormat.parse(String) instead
parse in class java.text.SimpleDateFormat
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||