After upgrading Hibernate from 5.2 to 6.2.0.CR4, on PostgreSQL v13, column data type="timestamp with time zone", ex value: "2023-04-13 04:42:16.992755-04", defined as java.time.ZonedDateTime, in UTC offset shows letter 'Z' instead of 'UTC'.
@Getter
@Setter
@ToString
@Column(name="updated_at")
private ZonedDateTime updatedAt;
Apr. 13, 2023 04:46p.m. Z
Apr. 13, 2023 04:42p.m. Z
Apr. 12, 2023 04:13p.m. Z
Apr. 12, 2023 04:13p.m. Z
<hibernate.core.version>6.2.0.CR4</hibernate.core.version>
application.properties (springboot v3.x)
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.jpa.properties.hibernate.timezone.default_storage=NORMALIZE_UTC
- on Hibernate 5.2 it was 'UTC' instead of 'Z' for timezone.
appreciate the help, --vs
The whole issue is boiling down to update usage of java.util.Date(JDK8) to java.time.ZonedDateTime(JDK17) while showing the output of ZonedDateTime with TimeZone in JSF view(using PrimeFaces) under SpringFramework(w/ Spring Boot, and JoinFaces).
Possible solution found so far (if anyone found any better, please post it too):
dummy.updatedAt- ZonedDateTime objectThan later on in the Java back end code we add our conversion method
And thus I get correct zone value in GUI: "Jan. 19, 2024 09:00p.m. EST"
Thanks to @BalusC!