I'm using Java 1.6. Is there a way to write a date format pattern that can parse both
2013-08-01
and
2013-08-01T00:00:00.000Z
? I have tried the following
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
but it only matches the second, and dies with a ParseException on the first. My parse code is:
final DateFormat defaultDateFormatObj = new SimpleDateFormat(classDateFormat);
final java.util.Date startDate = defaultDateFormatObj.parse(myDateString);
Thanks, - Dave