java.lang.Object
net.i2p.util.RFC822Date
Moved from NewsFetcher.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<SimpleDateFormat> Formatter for rendering a date, one per threadprivate static final ThreadLocal<SimpleDateFormat[]> Formatters tried when parsing, one set per threadConstructor Summary
ConstructorsConstructorDescriptionConstructor for subclasses; the formatters in this base class are static.Method Summary
Modifier and TypeMethodDescriptionprivate static SimpleDateFormat[]Build the set of RFC822 date formats used for parsing, all in GMT.static voidParse the argument and print the formatted date, for testing.static longNew Date(String foo) is deprecated, so let's do this the hard way.static Stringto822Date(long t) Format is "d MMM yyyy HH:mm:ss z".
Field Details
OUTPUT_FORMAT
Formatter for rendering a date, one per threadRFC822_DATE_FORMATS
Formatters tried when parsing, one set per thread
Constructor Details
RFC822Date
public RFC822Date()Constructor for subclasses; the formatters in this base class are static.
Method Details
createDateFormats
Build the set of RFC822 date formats used for parsing, all in GMT.- Returns:
- the array of accepted date formats
parse822Date
New Date(String foo) is deprecated, so let's do this the hard way.- Parameters:
s- non-null- Returns:
- -1 on failure
to822Date
Format is "d MMM yyyy HH:mm:ss z".- Parameters:
t- the time to format, in milliseconds since the epoch- Returns:
- the date rendered as an RFC 822 string in the local time zone
main
Parse the argument and print the formatted date, for testing.- Parameters:
args- an optional single epoch-seconds value to format, or none for the current time