Is it possible to create a DateFormatter which converts a two-digit year into a four-digit year?
- by DR
In my Java application I use a DateFormat instance to parse date inputs.
DateFormat fmt;
fmt = DateFormat.getDateInstance(DateFormat.DEFAULT) // dd.MM.yyyy for de_DE
The problem is that the user insists to enter dates in the form 31.12.11.
Unfortunately this is parsed to 31.12.11. (0011-12-31 in ISO format) Instead I want the parsed date to become 31.12.2011 (2011-12-31 in ISO format).
Can I modify the date format to somehow parse inputs that way?