| java.lang.Object com.sun.syndication.io.impl.DateParser
DateParser | public class DateParser (Code) | | A helper class that parses Dates out of Strings with date time in RFC822 and W3CDateTime
formats plus the variants Atom (0.3) and RSS (0.9, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0)
specificators added to those formats.
It uses the JDK java.text.SimpleDateFormat class attemtping the parse using a mask for
each one of the possible formats.
author: Alejandro Abdelnur |
Method Summary | |
public static String | formatRFC822(Date date) create a RFC822 representation of a date. | public static String | formatW3CDateTime(Date date) create a W3C Date Time representation of a date. | public 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.
Parameters: sDate - string to parse for a date. | public static Date | parseRFC822(String sDate) Parses a Date out of a String with a date in RFC822 format.
It parsers the following formats:
- "EEE, dd MMM yyyy HH:mm:ss z"
- "EEE, dd MMM yyyy HH:mm z"
- "EEE, dd MMM yy HH:mm:ss z"
- "EEE, dd MMM yy HH:mm z"
- "dd MMM yyyy HH:mm:ss z"
- "dd MMM yyyy HH:mm z"
- "dd MMM yy HH:mm:ss z"
- "dd MMM yy HH:mm z"
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: sDate - string to parse for a date. | public static Date | parseW3CDateTime(String sDate) Parses a Date out of a String with a date in W3C date-time format.
It parsers the following formats:
- "yyyy-MM-dd'T'HH:mm:ssz"
- "yyyy-MM-dd'T'HH:mmz"
- "yyyy-MM-dd"
- "yyyy-MM"
- "yyyy"
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: sDate - string to parse for a date. |
formatRFC822 | public static String formatRFC822(Date date)(Code) | | create a RFC822 representation of a date.
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: date - Date to parse the RFC822 represented by the given DateIt returns null if it was not possible to parse the date. |
formatW3CDateTime | public static String formatW3CDateTime(Date date)(Code) | | create a W3C Date Time representation of a date.
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: date - Date to parse the W3C Date Time represented by the given DateIt returns null if it was not possible to parse the date. |
parseDate | public static Date parseDate(String sDate)(Code) | | Parses a Date out of a String with a date in W3C date-time format or
in a RFC822 format.
Parameters: sDate - string to parse for a date. the Date represented by the given W3C date-time string.It returns null if it was not possible to parse the given string into a Date. |
parseRFC822 | public static Date parseRFC822(String sDate)(Code) | | Parses a Date out of a String with a date in RFC822 format.
It parsers the following formats:
- "EEE, dd MMM yyyy HH:mm:ss z"
- "EEE, dd MMM yyyy HH:mm z"
- "EEE, dd MMM yy HH:mm:ss z"
- "EEE, dd MMM yy HH:mm z"
- "dd MMM yyyy HH:mm:ss z"
- "dd MMM yyyy HH:mm z"
- "dd MMM yy HH:mm:ss z"
- "dd MMM yy HH:mm z"
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: sDate - string to parse for a date. the Date represented by the given RFC822 string.It returns null if it was not possible to parse the given string into a Date. |
parseW3CDateTime | public static Date parseW3CDateTime(String sDate)(Code) | | Parses a Date out of a String with a date in W3C date-time format.
It parsers the following formats:
- "yyyy-MM-dd'T'HH:mm:ssz"
- "yyyy-MM-dd'T'HH:mmz"
- "yyyy-MM-dd"
- "yyyy-MM"
- "yyyy"
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
Parameters: sDate - string to parse for a date. the Date represented by the given W3C date-time string.It returns null if it was not possible to parse the given string into a Date. |
|
|