Reputation: 80186
what is the joda-time equivalent of below methods in JDK.
My main idea is to store the below in database as suggested by most of the SO posts
Also should i store the RawOffset or the DST adjusted offset?
Upvotes: 3
Views: 1120
Reputation: 38777
If you just save the UTC instant and the timezone id (i.e. America/New York and Europe/London, not EST and GMT) then you don't need to worry about storing raw offsets. Especially as offsets change with annoying frequency. Let Joda and the tz database do all the work for you. So store:
With Java 8, just use ZonedDateTime
persisted via DateTimeFormatter.ISO_ZONED_DATE_TIME
.
Upvotes: 4