I have a Backend (upgraded from SpringBoot 2) on Spring Boot 3.0.13 with Hibernate 6.1.7.Final Spring 6.0.14 Everything waas fine with DateTime, OffsetTime, ZoneDateTime, + Timezone (application.yml property hibernate.jdbc.time_zone: UTC
)
Database is MySql 8.0.32 and offset_time column is “Time” type.
When I upgraded to Spring Boot 3.1.0 with Hibernate 6.2.2.Final Spring 6, my OffsetTime is not saved correctly in database and Timezone “serialization” is not correct.
@Column(name = "offset_time")
private OffsetTime offsetTime;
And YML proprties
jpa:
open-in-view: false
properties:
hibernate.jdbc.time_zone: UTC
hibernate.timezone.default_storage: NORMALIZE_UTC
- offsetTime variable is “14:30Z” before saving
- SELECT value time from database is “1970-01-01T13:30:00.000+0100”
So offsetTime is saved as if UTC is not considered with -1h and set in database with +1h keeping system default instead of stay in UTC. It seems to be an Hibernate 6.2.2 issue but I would like to knwo if there is a way to fix it.