Reputation: 12684
I don't live in a country using DST.
LocalDateTime
, Offset from UTC and ZoneId
in DBLocalDateTime
in that zoneIf I apply ZoneId
and Offset to get the LocalDateTime
in that zone, how does java.time
API get this correctly? How does it know that the government changes the rules? Does it fetch update from the internet?
Upvotes: 9
Views: 756
Reputation: 921
Timezone updates usually come with JRE updates. Whenever the timezone of some particular territory is changed, this information is included into the next version of JRE.
Here you can find some information on the timezone data for JRE/JDK.
If updating JRE/JDK is not an option, TZUpdater tool can be used to update only the timezone data without updating JRE/JDK.
All Java date/time APIs that support timezones implicitly use JRE's timezone data, so the only thing you need to worry about is keeping the timezone data in JRE up-to-date.
Upvotes: 7