public class DateParser extends Object
It uses the JDK java.text.SimpleDateFormat class attemtping the parse using a mask for each one of the possible formats.
Modifier and Type | Method and Description |
---|---|
static String |
formatRFC822(Date date)
Creates a RFC822 representation of a date.
|
static String |
formatW3CDateTime(Date date)
Creates a W3C Date Time representation of a date.
|
static Date |
parseDate(String sDate)
Parses a Date out of a String with a date in W3C date-time format or
in a RFC822 format.
|
static Date |
parseRFC822(String sDate)
Parses a Date out of a String with a date in RFC822 format.
|
static Date |
parseW3CDateTime(String sDate)
Parses a Date out of a String with a date in W3C date-time format.
|
public static Date parseRFC822(String sDate)
It parsers the following formats:
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
sDate
- string to parse for a date.public static Date parseW3CDateTime(String sDate)
It parsers the following formats:
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
sDate
- string to parse for a date.public static Date parseDate(String sDate)
sDate
- string to parse for a date.public static String formatRFC822(Date date)
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
date
- Date to formatpublic static String formatW3CDateTime(Date date)
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
date
- Date to formatCopyright © 2011 Nuxeo SA. All Rights Reserved.