| Vlad Mihalcea, thanks for clarification. Indeed, some of my configuration properties make the other useless. The issue occurred a while ago but I'm pretty sure I have tried out many different permutations of properties including hibernate.jdbc.time_zone without any success in the depicted scenario. However, I will double check. As you mentioned, the point in time stored in java.sql.Date we are getting from DB is correct (assuming we use midnight when converting from MySQL's DATE to date and time value) and it is pretty clear that the toString representation of the date uses the local timezone:
| MySQL Value (UTC+01:00) |
Date Value (UTC+01:00) |
Date Value (UTC+00:00) |
| 1980-01-01 |
1980-01-01T00:00:00.000+01:00 |
1979-12-31T23:00:00.000Z |
The following conversion to LocalDate, however, is obviously uses the same local timezone to determine the date part by cutting off the time part which does not works correctly in all timezones. The fix by Christian Beikov attached in the PR to this ticket makes it more clear. |