|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnan.tools.NNTPDateFormat
A helper class for static date formatting methods as required to implement the RFC 850 news message standard.
Field Summary | |
static java.text.SimpleDateFormat |
DISPLAY_FORMAT
The format for displaying a date and time. |
static java.text.SimpleDateFormat[] |
FORMATS
The potential date formats that can be parsed. |
static java.text.SimpleDateFormat |
SINCE_FORMAT
The format for 'since when' date-times like NEWNEWS and NEWGROUPS NNTP commands. |
Method Summary | |
static java.util.Date |
parseDate(java.lang.String text)
Parses an NNTP date string into a Date object. |
static java.lang.String |
toDisplayString(java.util.Date date)
Parses a Date object into a display date-time String. |
static java.lang.String |
toSinceDateString(java.util.Date date)
Parses a Date object into a 'since when' date-time String as required by commands like NEWNEWS and NEWGROUPS. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.text.SimpleDateFormat[] FORMATS
public static final java.text.SimpleDateFormat SINCE_FORMAT
public static final java.text.SimpleDateFormat DISPLAY_FORMAT
Method Detail |
public static java.lang.String toSinceDateString(java.util.Date date)
date
- The Date object to format.
public static java.lang.String toDisplayString(java.util.Date date)
date
- The Date to format.
public static java.util.Date parseDate(java.lang.String text) throws BadDateFormatException
text
- The date string to parse.
BadDateFormatException
- if the date string is in an unknown or
unparsable format.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |