New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a timezone bug in OffsetDateTime in Spring Boot 3.1.0. #3035
Comments
Have you tried downgrading Hibernate to version 6.1? |
I confirmed that it works fine after downgrading Hibernate to 6.1.7. It seems to be a bug in Hibernate 6.2. |
https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html#ddl-offset-time The default setting for OffsetDateTime has been changed since Hibernate 6.2.x. |
@bright-k If others need documentation, please refer to the following address: |
Using Hibernate 5.4.32 with MariaDb-10.0.38 jdbcUrl :
JPA entity type Instant field with
@Column(name = "create_time", insertable = false, updatable = false)
private Instant createTime; after setting this property, now epochSecond is correct spring.jpa.properties.hibernate.jdbc.time_zone=GMT+8 |
My working environment is as follows:
DB: 10.6.11-MariaDB
Timezone: +09:00 (system, db both)
You can reproduce the issue using the following steps:
Starting from Spring boot 3.0.7 version, it is stored in the following format in the DB.
The data is stored in the DB as a properly formatted value with the applied timezone of +09:00.
However, starting from Spring Boot 3.1.0, it is stored as UTC-based value with a -9-hour offset.
When converted to OffsetDateTime in the DB, it does not apply the timezone, resulting in a output of -9 hours.
Both the server and the DB are configured with the +09:00 timezone.
The text was updated successfully, but these errors were encountered: