-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
-
8
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Java version running is 1.8.0_232
A DESCRIPTION OF THE PROBLEM :
When we have a date in the following format, 2021-04-16T16:42:15.003Z, the Instant class's toString method works as expected. However, when it is perfectly on a second (0ms) like this, 2021-04-16T16:42:15.000Z, then the toString method strips off the milliseconds and the returned date is rounded to the nearest second.
i.e. 2021-04-16T16:42:15Z
When passing in this timestamp as a RequestParameter to a controller function that accepts a @DateTimeFormat(iso = DATE_TIME) Date date, the milliseconds are required, therefore the truncation causes an exception.
My proposal would be to keep the milliseconds in the stringified timestamp.
Java version running is 1.8.0_232
A DESCRIPTION OF THE PROBLEM :
When we have a date in the following format, 2021-04-16T16:42:15.003Z, the Instant class's toString method works as expected. However, when it is perfectly on a second (0ms) like this, 2021-04-16T16:42:15.000Z, then the toString method strips off the milliseconds and the returned date is rounded to the nearest second.
i.e. 2021-04-16T16:42:15Z
When passing in this timestamp as a RequestParameter to a controller function that accepts a @DateTimeFormat(iso = DATE_TIME) Date date, the milliseconds are required, therefore the truncation causes an exception.
My proposal would be to keep the milliseconds in the stringified timestamp.