Open nanella opened 2 years ago
As so often with dates there are more then one thing coming together here:
java.sql.Timestamp
really shouldn't happen after registering LocalDate
as a simple datatype. But it still does. This will be tracked by #1136
Currently, using a
java.time.LocalDate
on an entity results in funny behaviour when loading it from the database (e.g. adding or removing a day depending on timezone), since the database result is converted tojava.sql.Date
before being converted toLocalDate
, therefore adding in some timezone shenaningans. (See also https://github.com/spring-projects/spring-data-jdbc/issues/663#issuecomment-890974162, https://github.com/spring-projects/spring-data-jdbc/issues/663#issuecomment-895959933 and https://github.com/pgjdbc/pgjdbc/issues/2221.)Example with application in UTC+2 time-zone:
java.time.LocalDate.toString()
): "1000-01-01"DATE
type): "1000-01-01"java.time.LocalDate.toString()
): "0999-12-31"I may add a code example to reproduce once I find the time.