GeezerVison is showing netty.io — DateFormatter (Netty API Reference (4.1.141.Final))
Class DateFormatter
public final class DateFormatter
extends Object
A formatter for HTTP header dates, such as "Expires" and "Date" headers, or "expires" field in "Set-Cookie".
On the parsing side, it honors RFC6265 (so it supports RFC1123).
Note that:
- Day of week is ignored and not validated
- Timezone is ignored, as RFC6265 assumes UTC
If you're looking for a date format that validates day of week, or supports other timezones, consider using
java.util.DateTimeFormatter.RFC_1123_DATE_TIME.
On the formatting side, it uses a subset of RFC1123 (2 digit day-of-month and 4 digit year) as per RFC2616.
This subset supports RFC6265.
- See Also:
-
-
Method Summary
Modifier and Type
Method
Description
Format a Date into RFC1123 format
Parse some text into a Date, according to RFC6265
Parse some text into a Date, according to RFC6265
void
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
parseHttpDate
Parse some text into a Date, according to RFC6265
- Parameters:
txt - text to parse
- Returns:
- a
Date, or null if text couldn't be parsed
-
parseHttpDate
Parse some text into a Date, according to RFC6265
- Parameters:
txt - text to parse
start - the start index inside txt
end - the end index inside txt
- Returns:
- a
Date, or null if text couldn't be parsed
-
format
Format a Date into RFC1123 format
- Parameters:
date - the date to format
- Returns:
- a RFC1123 string
-
append
- Parameters:
date - the date to format
sb - the StringBuilder
- Returns:
- the same StringBuilder
-
|