Package com.day.cq.dam.commons.util
Class DateParser
java.lang.Object
com.day.cq.dam.commons.util.DateParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DateTry to parse a date using as many methods as possible, until one works.static DateparseRFC822Date(String sDate) Parse an RFC 822-style date string.static DateparseW3CDate(String sDate) Parse a W3C date string.
-
Constructor Details
-
DateParser
public DateParser()
-
-
Method Details
-
parseDate
Try to parse a date using as many methods as possible, until one works.- Parameters:
sDate- the date string- Returns:
- the corresponding date, or null if not parseable or if the date string is empty or null
-
parseRFC822Date
Parse an RFC 822-style date string.- Parameters:
sDate- the date string- Returns:
- the corresponding date, or null if not parseable or if the date string is empty or null
-
parseW3CDate
Parse a W3C date string. Not comprehensive.- Parameters:
sDate- the date string- Returns:
- the corresponding date, or null if not parseable or if the date string is empty or null
-