News for hackers. Stuff that matters.
Re:Governments Worldwide Consider Ditching Daylight Saving Time by jt2190 on Saturday October 31, 2020 @11:02AM (#24951992)
> Java seems to have its own TZDB so in general your OS and application layer might disagree about zones.

More precisely, the Java Virtual Machine (not the programming language) will, like any operating system running inside a VM, need to be patched with the new time information. Updating the host machine’s time info is not enough.

Re:Governments Worldwide Consider Ditching Daylight Saving Time by heavenlyblue on Saturday October 31, 2020 @11:07AM (#24952022)
Why does JVM need to know about time zones?
Re:Governments Worldwide Consider Ditching Daylight Saving Time by adrianmonk on Saturday October 31, 2020 @11:28AM (#24952194)
It's not the VM engine (JIT compiler, etc.) itself, of course. It's a data file that resides in the Java Runtime Environment directory, and some of the standard library code uses this file.

I assume it's done this way because it's the most foolproof way to get consistency across all platforms.

If Java did delegate, it might be hard (or even impossible?) to get the same behavior out of all the different underlying APIs on each platform. And it would be challenging to create the tests to validate that it really does behave consistently.

Also, although it creates extra maintenance work, it has the advantage that it decouples Java-level and OS-level updates. Suppose development machines run one OS (with its TZ data) but QA and production run a different OS. To harmonize environments as closely as possible, it's helpful that you can keep the TZ data versions on all JVMs in sync without relying on multiple OS vendors' patch processes to enable that.

Re:Governments Worldwide Consider Ditching Daylight Saving Time by lou1306 on Saturday October 31, 2020 @11:17AM (#24952108)
I guess it allows you to implement a JVM that runs on bare metal, or a host without timezone support.
Re:Governments Worldwide Consider Ditching Daylight Saving Time by jholloway7 on Saturday October 31, 2020 @11:48AM (#24952389)
Yep, it makes it easier to port the JRE to platforms like Windows that have an entirely different TZ system. Python, for example, has the same problem. Historically, Python took the stance of providing a "naive" datetime module that provides a conversion API, but delegated the actual TZ conversion to external implementations (dateutil, pytz). Only recently (as of 3.9) have they added a stdlib implementation that uses system-level zoneinfo by default.
Re:Governments Worldwide Consider Ditching Daylight Saving Time by Kwpolska on Saturday October 31, 2020 @11:14AM (#24952080)
Java is not an operating system. Other environments, such as .NET Core, don’t have any issues using the OS timezone database: https://devblogs.microsoft.com/dotnet/cross-platform-time-zo...