Open SchmidtThomas opened 6 years ago
This worked prior to this change: https://github.com/JadiraOrg/jadira/commit/b5c662923cd86f778b20897cdfe592140e21f133
Now jadira is incapable of converting dates during the repeated 1am hour during the daylight time changeover.
Looks like the problem for me is in TimestampColumnDateTimeMapper
:
The change from
DateTime dateTime = new DateTime(value.getTime());
to:
DateTime dateTime = DATETIME_FORMATTER.parseDateTime(value.toString());
makes it completely mess up dates in the daylight saving time repeated 1am hour. Converting it first to a string loses timezone information.
Upgrading from Version 6.0.1.GA to 7.0.0.RC1 we encountered the following issue:
We use the following JPA Mapping to persist a Joda Datetime field.
In all versions before 7.0.0.RC1 the Date "2018-11-05T23:59:59+01:00" would result in the following DB Entries.
Time is saved in UTC, Timezone information is written to the second field. After reading the record from DB, the timezone gets reapplied and the Joda DateTime Object in Memory is set to "23:59:59".
After upgrading to 7.0.0.RC1 the same date gets persisted like this:
The time is not saved in UTC anymore and is written as is. When reading from DB the Joda DateTime Object in Memory is set correctly to "23:59:59".
This works fine for all new records inserted by the new version of Jadira, but all old records are off by one hour (or better the zone offset).
Is this breaking change intended or did it happen by mistake?
regards
Thomas