Doesn’t meter what string I pass to parse I’m always getting Illegal Argument exception on GWT DateTimeFormat.parse method.
For instance, what is wrong on the following code line:?
Date date = DateTimeFormat.getFormat("MM-dd-YYYY").parse("10-10-2012");
I get:
java.lang.IllegalArgumentException: 10-10-2012
at com.google.gwt.i18n.shared.DateTimeFormat.parse
Instead of
YYYYfor the year in the format, you should useyyyy. The format you are specifiying would match a date that looks like:10-10-YYYY(since Y isn’t a special date format character).