java.lang.Object
io.sf.jclf.text.DateFormatUtil
Convenience class for DateFormat utility functions
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
DateFormatUtil
public DateFormatUtil()Generic utility to parse dates.
-
-
Method Details
-
guessDate
Guesses a date from a String, not knowing the format in advance. Assumes that the date to be guessed is less than SANITY_INTERVAL (20 yrs) from now. Use with caution. TODO: Use locale information, if available, to guess the date.- Parameters:
formatted_date
- the date to parse.- Returns:
- the parsed date, or null if could not be parsed.
-
guessDate
Try to guess a date from formatted_date, using refdate as a reference.- Parameters:
refdate
- the reference date. If the parsed date is not within a sanity interval, it will be rejected and a different parsing format will be used.formatted_date
- the string to parse.- Returns:
- the parsed date, or null if could not be parsed.
-