I have input with dates in many differing formats. I'm basically trying to take all the different formats and standardize them into ISO 8601 format.
If the date contains a month name, e.g., March, then I'm using the following function to get the month number, e.g. 03.
month = String.valueOf(Month.valueOf(month.toUpperCase()).getValue());
Anyway, the problem I am having is that the month names are in many different languages, with no indication what language they will be. I'm getting the following error when running the above function:
Caused by: java.lang.IllegalArgumentException: No enum constant java.time.Month.AUGUSTI
at java.lang.Enum.valueOf(Enum.java:238)
at java.time.Month.valueOf(Month.java:106)
Is there any library that can deal with month names in many different languages, returning the numeric value, or even just translating the month name to English?
Here's a sample of the input date:
1370037600
1385852400
1356994800
2014-03-01T00:00:00
2013-06-01T00:00:00
2012-01-01
2012
May 2012
März 2010
Julio 2009