Closed
Description
Per Holmberg opened SPR-14675 and commented
First, the javadoc example for DateTimeFormat.ISO.DATE_TIME is wrong; literal 'T' should be used between date and time. But even when this corrected it does not work:
DateFormatter formatter = new DateFormatter();
formatter.setIso(DateTimeFormat.ISO.DATE_TIME);
formatter.parse("2000-10-31T01:30:00.000-05:00", Locale.getDefault());
Reason is the pattern specified in DateFormatter is wrong; for ISO, X should be used for timezone instead of Z (se javadoc for SimpleDateFormat). Correct pattern: yyyy-MM-dd'T'HH:mm:ss.SSSXXX
I guess same applies to DateTimeFormat.ISO.TIME.
Affects: 4.2.7, 4.3.2
Issue Links:
- @DateTimeFormat(iso = ISO.DATE_TIME) should use optimized formatter for LocalDateTime [SPR-14958] #19525
@DateTimeFormat
(iso = ISO.DATE_TIME) should use optimized formatter for LocalDateTime
Referenced from: commits bb94ba6, db196ce, a5070d5, 68332bf, d5c9cc6