humbertosales NA (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-16722 (
https://hibernate.atlassian.net/browse/HHH-16722?atlOrigin=eyJpIjoiNTU4M2...
)
Re: LocalDateTime values are wrong in START and END Daylight saving (non UTC timezone) (
https://hibernate.atlassian.net/browse/HHH-16722?atlOrigin=eyJpIjoiNTU4M2...
)
Workaround with Converters
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
@Converter(autoApply = true )
public class LocalDateTimeToTimestampConverter implements
AttributeConverter<LocalDateTime, Timestamp> {
@Override
public Timestamp convertToDatabaseColumn(LocalDateTime attribute) {
ZonedDateTime zonedDateTime = attribute.atZone(ZoneId.of( "UTC" ));
return Timestamp.from(zonedDateTime.toInstant());
}
@Override
public LocalDateTime convertToEntityAttribute(Timestamp dbData) {
return dbData.toInstant().atZone(ZoneId.of( "UTC" )).toLocalDateTime();
}
}
(
https://hibernate.atlassian.net/browse/HHH-16722#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16722#add-comment?atlOrigin=ey...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:d82e018 )