I´m having a stupid problem with java.util.Date
.
I have this line of code, but I don´t understand why this date is unparseable with this format.
Seems to be a Locale-related problem.
If I set a French locale, the pattern does not work. If I set the Locale to be US in the SimpleDateFormat constructor, it does works.
SimpleDateFormat dFormat = new SimpleDateFormat(DATE_FORMAT, Locale.US);
If your system uses a locale other than English you need to use this constructor:
SimpleDateFormat(DATE_FORMAT,Locale.ENGLISH);
If this is not the problem, you should format a date using the same formatter and compare the output to your input string.
I don't see anything wrong with this. It executes for me without error, and returns:
Sat Dec 31 09:00:00 GMT 2011