Open Alice52 opened 4 years ago
consider convert all data time type to UTC when persisted to database by annotation
结合 java8 的 LocalDateTime
思路: 代码中可见的时间都是 local 时间
代码中可见的时间都是 local 时间
https://stackoverflow.com/questions/508019/how-to-store-date-time-and-timestamps-in-utc-time-zone-with-jpa-and-hibernate/3430957
https://stackoverflow.com/questions/9533935/how-to-force-hibernate-to-return-dates-as-java-util-date-instead-of-timestamp
TypeHandlerCallback
TimestampType and TimestampTypeDescriptor
now date time create in code will be utc time?
consider convert all data time type to UTC when persisted to database by annotation
结合 java8 的 LocalDateTime
思路:
代码中可见的时间都是 local 时间
reference
https://stackoverflow.com/questions/508019/how-to-store-date-time-and-timestamps-in-utc-time-zone-with-jpa-and-hibernate/3430957
https://stackoverflow.com/questions/9533935/how-to-force-hibernate-to-return-dates-as-java-util-date-instead-of-timestamp