public final class HttpDateFormat
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ANSI_C_ASCTIME_DATE_FORMAT_PATTERN
The date format pattern for ANSI C asctime().
|
private static java.lang.ThreadLocal<java.util.List<java.text.SimpleDateFormat>> |
dateFormats |
private static java.util.TimeZone |
GMT_TIME_ZONE |
private static java.lang.String |
RFC1036_DATE_FORMAT_PATTERN
The date format pattern for RFC 1036.
|
private static java.lang.String |
RFC1123_DATE_FORMAT_PATTERN
The date format pattern for RFC 1123.
|
Modifier | Constructor and Description |
---|---|
private |
HttpDateFormat() |
Modifier and Type | Method and Description |
---|---|
private static java.util.List<java.text.SimpleDateFormat> |
createDateFormats() |
private static java.util.List<java.text.SimpleDateFormat> |
getDateFormats()
Return an unmodifiable list of HTTP specified date formats to use for
parsing or formatting
Date . |
static java.text.SimpleDateFormat |
getPreferredDateFormat()
Get the preferred HTTP specified date format (RFC 1123).
|
static java.util.Date |
readDate(java.lang.String date)
Read a date.
|
private static final java.lang.String RFC1123_DATE_FORMAT_PATTERN
private static final java.lang.String RFC1036_DATE_FORMAT_PATTERN
private static final java.lang.String ANSI_C_ASCTIME_DATE_FORMAT_PATTERN
private static final java.util.TimeZone GMT_TIME_ZONE
private static final java.lang.ThreadLocal<java.util.List<java.text.SimpleDateFormat>> dateFormats
private static java.util.List<java.text.SimpleDateFormat> createDateFormats()
private static java.util.List<java.text.SimpleDateFormat> getDateFormats()
Date
.
The list of date formats are scoped to the current thread and may be used without requiring to synchronize access to the instances when parsing or formatting.
public static java.text.SimpleDateFormat getPreferredDateFormat()
The date format is scoped to the current thread and may be used without requiring to synchronize access to the instance when parsing or formatting.
public static java.util.Date readDate(java.lang.String date) throws java.text.ParseException
date
- the date as a string.java.text.ParseException
- in case the date string cannot be parsed.