Package org.docx4j.model.fields
Class DateFormatInferencer
java.lang.Object
org.docx4j.model.fields.DateFormatInferencer
From http://stackoverflow.com/questions/3389348/parse-any-date-in-java
with modifications for locale
See http://stackoverflow.com/questions/3307330/using-joda-date-time-api-to-parse-multiple-formats
for similar in Joda
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdetermineDateFormat(String dateString) Determine SimpleDateFormat pattern matching with the given date string.static void
-
Constructor Details
-
DateFormatInferencer
public DateFormatInferencer()
-
-
Method Details
-
determineDateFormat
Determine SimpleDateFormat pattern matching with the given date string. Returns null if format is unknown. You can simply extend DateUtil with more formats if needed.- Parameters:
dateString- The date string to determine the SimpleDateFormat pattern for.- Returns:
- The matching SimpleDateFormat pattern, or null if format is unknown.
- See Also:
-
main
- Throws:
Exception
-