Closed kbareja closed 1 year ago
Yeah, the use of custom DateTimeFormatter was the culprit. I switched the entire framework to the standard ISO formatters from the JDK. The error no longer occurs. Since this is a somewhat invasive change, it is 5.0 only.
My general recommendation would be to avoid java.sql.Date
/ java.sql.Time
/ java.sql.Timestamp
, and use java.time.Local*
flavor
I’ve bumped into some issues related to AgRest time formatting. That time is too far away from unix epoch, time formatting becomes strange (e.g. adds random time to results). For usual dates, like full 20th century seems to work fine, Problem starts when it comes deeper into past:
I’ve created tests to visualise it (note that it might return different results in different local timezone. I use CET ):
Problem most likely is in
io.agrest.encoder.ISODateTimeEncoder
line:I blame this conversion via ofEpochMilli but honestly didn’t test it too deep. (we still have v 4.10)