1
我有一個場景,我需要存儲日期時間,其中有時區,而不是轉換爲本地時區。堅持在提供的時區使用Joda PersistentDateTime
例如,我在Europe/Berlin
時區和America/New_York
時區獲得日期。如果我的JVM在柏林,則America/New_York
的日期時間正在轉換爲柏林時區。
我用彈簧註釋:
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
我知道這個轉換提供datetime,在localdatetime堅持。但是如何避免這種情況,並將日期時間存儲在任何時區。有沒有其他類型的功能?