public class HttpDateFormatter
extends java.lang.Object
implements java.io.Serializable
HTTP-date = rfc1123-date rfc1123-date = wkday "," SP date1 SP time SP "GMT" date1 = 2DIGIT SP month SP 4DIGIT ; day month year (e.g., 02 Jun 1982) time = 2DIGIT ":" 2DIGIT ":" 2DIGIT ; 00:00:00 - 23:59:59 wkday = "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun" month = "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"An example is
Sun, 06 Nov 1994 08:49:37 GMT
These are used in request and response headers.
Based on net.sf.ehcache.constructs.web.HttpDateFormatter.Modifier and Type | Field and Description |
---|---|
protected java.text.SimpleDateFormat |
httpDateFormat |
Constructor and Description |
---|
HttpDateFormatter()
Constructs a new formatter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatHttpDate(java.util.Date date) |
java.util.Date |
parseDateFromHttpDate(java.lang.String date)
Parses dates supplied in accordance with Section 3.3.1 of RFC 2616
|
public HttpDateFormatter()
public java.lang.String formatHttpDate(java.util.Date date)
date
- public java.util.Date parseDateFromHttpDate(java.lang.String date)
date
- a date formatted in accordance with Section 3.3.1 of RFC 2616