[hibernate-issues] [JIRA] (HHH-13987) LocalDate is affected by timezone conversions

Vlad Mihalcea (JIRA) jira at hibernate.atlassian.net
Thu Apr 30 03:24:58 EDT 2020


Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) *closed* an issue as *Rejected*

This was caused by a MySQL Connector/J bug that was fixed in 8.0.20 ( https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-20.html ) :

When a Calendar was not used, a java.sql.Date value could not always be stored into and then retrieved from a MySQL server consistently. It was because Connector/J always converted a Date value to the server's time zone when storing it on the server as a MySQL DATE; but since a MySQL DATE does not have any time value, the hour, minute, and second parts of the original date was effectively lost. If the converted value is one day ahead of or behind the original value, when the value was retrieved through Connector/J and converted back to the local time zone, there was no time value for adjusting the date back to its original value, resulting in a one-day error. With this fix, any Date value is converted to MySQL DATE value using the JVM's time zone, so that the value is always consistent when being stored and then read back.

Also, the cacheDefaultTimezone connection property, previously removed from Connector/J 8.0, has now been restored so that when it is set to false, Connector/J becomes aware of the time zone changes of the JVM during runtime and converts dates with the updated time zone. (Bug #28125069, Bug #91112)

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13987?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 ) HHH-13987 ( https://hibernate.atlassian.net/browse/HHH-13987?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 ) LocalDate is affected by timezone conversions ( https://hibernate.atlassian.net/browse/HHH-13987?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 )

Change By: Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) Resolution: Rejected Status: Open Closed

( https://hibernate.atlassian.net/browse/HHH-13987#add-comment?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13987#add-comment?atlOrigin=eyJpIjoiMzc2ZjdkYmRkMWE4NDQ4NmJkOTRjYzIyZTFiOTk4NTAiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:e06514a )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200430/898637ba/attachment.html 


More information about the hibernate-issues mailing list