|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.tools.web.ParseDate
Parser for date format in HTTP rfc1123, rfc850 or asctime
Field Summary | |
static java.lang.String |
ASCTIME_FORMAT
|
(package private) static java.util.Hashtable |
longNames
|
static java.lang.String |
RFC1123_FORMAT
|
static java.lang.String |
RFC850_FORMAT
|
(package private) static java.util.Hashtable |
shortNames
|
Constructor Summary | |
ParseDate()
|
Method Summary | |
(package private) static void |
Initialization of day-of-week name tables |
static java.lang.String |
asctime(java.util.Date d)
Formats a Date in ASCTIME format |
static java.lang.String |
format(java.util.Date d,
java.lang.String format)
Formats a Date |
(package private) static void |
insertName(java.lang.String shortName,
java.lang.String longName)
Inserts a short and a long day-of-week name in the respective tables, with the corresponding WeekDay object as value |
static java.lang.String |
long2short(java.lang.String day)
Finds the short day name corresponding to the long name |
static java.util.Date |
parse(java.lang.String date)
Parses a date string, trying RFC1123, RFC850 and ASCTIME formats in turn |
static java.util.Date |
parse(java.lang.String date,
java.lang.String format)
Parses a date String with a specified format |
static java.util.Date |
parseASCTIME(java.lang.String date)
Parses ASCTIME string Example: Mon Jan 2 22:11:06 1982 |
static java.util.Date |
parseRFC1123(java.lang.String date)
Parses date string according to RFC1123 Example: Mon, 02 Jun 1982 22:11:06 GMT |
static java.util.Date |
parseRFC850(java.lang.String date)
Parses date string according to RFC850 Example: Monday, 02-Jan-82 22:11:06 GMT |
static java.lang.String |
rfc1123(java.util.Date d)
Formats a Date according to RFC1123 |
static java.lang.String |
rfc850(java.util.Date d)
Formats a Date according to RFC850 |
static java.lang.String |
short2long(java.lang.String day)
Finds the long day name corresponding to the short name |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Field Detail |
static java.util.Hashtable longNames
static java.util.Hashtable shortNames
public static final java.lang.String RFC1123_FORMAT
public static final java.lang.String RFC850_FORMAT
public static final java.lang.String ASCTIME_FORMAT
Constructor Detail |
public ParseDate()
Method Detail |
static void()
static void insertName(java.lang.String shortName, java.lang.String longName)
shortName
- Short form of day namelongName
- Long form of day namepublic static java.lang.String long2short(java.lang.String day)
day
- Long day namepublic static java.lang.String short2long(java.lang.String day)
day
- Short day namepublic static java.util.Date parse(java.lang.String date, java.lang.String format)
date
- The date/time stringformat
- The formatpublic static java.util.Date parseRFC1123(java.lang.String date)
date
- The date/time stringpublic static java.util.Date parseRFC850(java.lang.String date)
date
- The date/time stringpublic static java.util.Date parseASCTIME(java.lang.String date)
date
- The date/time stringpublic static java.util.Date parse(java.lang.String date)
date
- The date/time stringpublic static java.lang.String format(java.util.Date d, java.lang.String format)
d
- The date objectformat
- The format string for the outputpublic static java.lang.String rfc850(java.util.Date d)
d
- The date objectpublic static java.lang.String rfc1123(java.util.Date d)
d
- The date objectpublic static java.lang.String asctime(java.util.Date d)
d
- The date object
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |