| I do not think the problem is in the JDK. Apparently, we had some weird timezones in the Netherlands before World War 2. I believe the problem is the way the conversion is done by Hibernate. I am using a LocalDateTime, which has by definition no timezone. But in the class org.hibernate.type.descriptor.java.LocalDateTimeJavaDescriptor (and LocalDateJavaDescriptor) a timezone is used in the conversion. But because the LocalDateTime has no timezone info in it, this should not be used for the conversion. As a workaround I implemented my own LocalDateTimeUserType that does the conversion as follows:
Timestamp ts = java.sql.Timestamp.valueOf(localDateTime);
and
LocalDateTime ldt = timestamp.toLocalDateTime();
|