Search to learn more such as using the Java type LocalDateTime with one column type and OffsetDateTime with the other column type. This has been covered many many times already on Stack Overflow, with many existing Answers including some written by me. To store that moment you need to define your column as TIMESTAMP WITH TIME ZONE. That, combined with a date and time, determines a moment. The Z at the end of your input string means an offset of zero hours-minutes-seconds from UTC. But we have no way to know if that was meant to be noon in Tokyo, noon in Toulouse, or noon in Toledo - three very different moments, several hours apart. That type stores only a date with time-of-day, such as noon on Jan 23rd next year. The type TIMESTAMP WITHOUT TIME ZONE cannot represent a moment, a specific point on the timeline. You have chosen the wrong data type for your column. (this is Instant) to Postgresql Timestamp without timezone. You should get the same behaviour even you do not use JPA. It makes your app have more deterministic timezone behaviour which will not affected by the timezone setting of JVM or server 's OS.īy the way, it is more about the JDBC driver that adjust the time but not JPA. So if you are using hibernate, I would suggest to configure _zone to UTC which aligns with the expected timezone of the date time storing in DB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |