| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | DateUtils.DateFormatHolder
A factory for |
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | |
| private static final Date | |
| public static final TimeZone | |
| public static final String | PATTERN_ASCTIME
Date format pattern used to parse HTTP date headers in ANSI C
|
| public static final String | PATTERN_RFC1036
Date format pattern used to parse HTTP date headers in RFC 1036 format. |
| public static final String | PATTERN_RFC1123
Date format pattern used to parse HTTP date headers in RFC 1123 format. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static String | Returns: An RFC 1123 formatted date string.The date to format. date)Formats the given date according to the RFC 1123 pattern. |
| public static String | Returns: A formatted date string.The date to format. date, final String The pattern to use for formatting the date. pattern)Formats the given date according to the specified pattern. |
| public static Date | |
| public static Date | |
| public static Date | Returns: the parsed date or null if input could not be parsedthe date value to parse dateValue, final String[] the date formats to use dateFormats, final Date During parsing, two digit years will be placed in the range
startDate)startDate to startDate + 100 years. This value may
be null. When null is given as a parameter, year
2000 will be used.Parses the date value using the given date formats. |
| DEFAULT_PATTERNS | back to summary |
|---|---|
| private static final String[] DEFAULT_PATTERNS | |
| DEFAULT_TWO_DIGIT_YEAR_START | back to summary |
|---|---|
| private static final Date DEFAULT_TWO_DIGIT_YEAR_START | |
| GMT | back to summary |
|---|---|
| public static final TimeZone GMT | |
| PATTERN_ASCTIME | back to summary |
|---|---|
| public static final String PATTERN_ASCTIME Date format pattern used to parse HTTP date headers in ANSI C
| |
| PATTERN_RFC1036 | back to summary |
|---|---|
| public static final String PATTERN_RFC1036 Date format pattern used to parse HTTP date headers in RFC 1036 format. | |
| PATTERN_RFC1123 | back to summary |
|---|---|
| public static final String PATTERN_RFC1123 Date format pattern used to parse HTTP date headers in RFC 1123 format. | |
| DateUtils | back to summary |
|---|---|
| private DateUtils() This class should not be instantiated. | |
| clearThreadLocal | back to summary |
|---|---|
| public static void clearThreadLocal() Clears thread-local variable containing
| |
| formatDate | back to summary |
|---|---|
| public static String formatDate(final Date date) Formats the given date according to the RFC 1123 pattern.
| |
| formatDate | back to summary |
|---|---|
| public static String formatDate(final Date date, final String pattern) Formats the given date according to the specified pattern. The pattern
must conform to that used by the
| |
| parseDate | back to summary |
|---|---|
| public static Date parseDate(final String dateValue) Parses a date value. The formats used for parsing the date value are retrieved from the default http params. | |
| parseDate | back to summary |
|---|---|
| public static Date parseDate(final String dateValue, final String[] dateFormats) Parses the date value using the given date formats. | |
| parseDate | back to summary |
|---|---|
| public static Date parseDate(final String dateValue, final String[] dateFormats, final Date startDate) Parses the date value using the given date formats.
| |
SimpleDateFormats. The instances are stored in a
threadlocal way because SimpleDateFormat is not threadsafe as noted in
its javadoc.
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static SimpleDateFormat | Returns: the requested format. This simple dateformat should not be used toapply to a
different pattern.a non- pattern)null format String according to
SimpleDateFormat. The format is not checked against
null since all paths go through
DateUtils.creates a |
| THREADLOCAL_FORMATS | back to summary |
|---|---|
| private static final ThreadLocal<SoftReference<Map<String, SimpleDateFormat>>> THREADLOCAL_FORMATS | |
| DateFormatHolder | back to summary |
|---|---|
| pack-priv DateFormatHolder() | |
| clearThreadLocal | back to summary |
|---|---|
| public static void clearThreadLocal() | |
| formatFor | back to summary |
|---|---|
| public static SimpleDateFormat formatFor(final String pattern) creates a
| |