Package net.targetr.wtm3.io
Class Rfc822Date
java.lang.Object
net.targetr.wtm3.io.Rfc822Date
Parses and formats RFC-822 dates. GMT ONLY!
This class is designed to quickly parse and format dates in the style specified in RFC-822. Unlike SimpleDateFormat it is thread safe and lightweight.
- Author:
- Dr Michael Gardiner
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatCookieDate
(long time) Returns a string in RFC-822 format for Cookies.static String
formatDate
(long time) Returns a string in RFC-822 format.static long
Parses a string in RFC-822 format.
-
Method Details
-
formatDate
Returns a string in RFC-822 format.- Parameters:
time
- The time in millis since epoc to format.- Returns:
- The time as a string suitable for HTTP headers.
-
formatCookieDate
Returns a string in RFC-822 format for Cookies. (Dashes between date components)- Parameters:
time
- The time in millis since epoc to format.- Returns:
- The time as a string suitable for HTTP headers.
-
parseDate
Parses a string in RFC-822 format.- Parameters:
str
- The date in RFC-822 date format.- Returns:
- The number of millis since epoc.
-