-
Notifications
You must be signed in to change notification settings - Fork 364
Open
Labels
in: mappingMapping and conversion infrastructureMapping and conversion infrastructuretheme: date-timeIssues related to handling of date, time and timezone informationIssues related to handling of date, time and timezone informationtype: bugA general bugA general bug
Description
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 to java.sql.Date
before being converted to LocalDate
, therefore adding in some timezone shenaningans. (See also #663 (comment), #663 (comment) and pgjdbc/pgjdbc#2221.)
Example with application in UTC+2 time-zone:
- date to be saved (
java.time.LocalDate.toString()
): "1000-01-01" - field in database (postgres
DATE
type): "1000-01-01" - result when loading entity via spring-data-jdbc (
java.time.LocalDate.toString()
): "0999-12-31"
I may add a code example to reproduce once I find the time.
Metadata
Metadata
Assignees
Labels
in: mappingMapping and conversion infrastructureMapping and conversion infrastructuretheme: date-timeIssues related to handling of date, time and timezone informationIssues related to handling of date, time and timezone informationtype: bugA general bugA general bug