https://www.independent.co.uk/news/world/clocks-change-kille...
This is a whole other class, though.
And no, you can't update the timezone database yourself. It resides on the system partition which requires root or at least an unlocked bootloader to mount as writable.
If I recall, Egypt's DST change several years ago was announced so close to the changeover that IANA was updated after it happened. It's possible there is even an instance where the DST change was enacted retroactively.
Java also ships their own SSL trust store instead of using the system one. Why, just why?! Every system capable of running Java also has its own trust store...
This makes using internal CAs a nightmare.
No, they don't: https://en.wikipedia.org/wiki/Java_Card
there are also other examples of java running in embedded and semi-embedded scenarios where a TZDB and a SSL trust store would not be guaranteed by the host.
There's also a consistency issue --- write once, run everywhere doesn't work if you need to resign your webstart program based on the OS you're running on.
Well, there is also Joda time and icu4j that have their own TZDB which caused me one very stressful day until we found this fact.
Honestly though, this should only be a problem for the small subset of embedded software without access to the Internet. If major OSes time zone databases are not able to be updated independently of the rest of the OS, that's kind of on them. We know time zone boundaries have been changing arbitrarily for decades, so shouldn't this be a solved problem?
$ zdump -v US/Eastern | grep 2020
US/Eastern Sun Mar 8 06:59:59 2020 UT = Sun Mar 8 01:59:59 2020 EST isdst=0 gmtoff=-18000
US/Eastern Sun Mar 8 07:00:00 2020 UT = Sun Mar 8 03:00:00 2020 EDT isdst=1 gmtoff=-14400
US/Eastern Sun Nov 1 05:59:59 2020 UT = Sun Nov 1 01:59:59 2020 EDT isdst=1 gmtoff=-14400
US/Eastern Sun Nov 1 06:00:00 2020 UT = Sun Nov 1 01:00:00 2020 EST isdst=0 gmtoff=-18000
If everyone simply picked a zone and stayed there, without the switching schedule above, you'd only need a mapping of zone to GMT offset and be done with it.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.
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.
To be clear, the software perspective is to use Unix time instead.[0]
Most machines use UTC internally (with varying epoch dates to represent it). And this is absolutely great until you need to interface with meatbags, ie local time. It's not just display of time either: think about anything Cron does in localtime, eg backups or open building door locks, or send an ACH payment file; then ponder all the corner cases of DST switches. Eg do you do something twice, or never? What if you reboot somewhere in the DST switch period? etc. All these shenanigans are dictated by the TZDB.
Oh, and UTC also contains leap seconds.
I don't recall how `cron` and other schedulers handle it, though.
Things either happened twice or never, it was always really painful. In any growth company, I would imagine that these things keep occurring, as people haven't hit the bugs themselves yet.
No, they rally aren't. Most machines use Posix time internally, and the fact that it doesn't reflect real-world leap seconds is a problem.
I have to agree. The function of software is to reflect the state of reality as it is. Human sociopolitical reality is complicated; that's just a problem to deal with.
The world: LOL
Every time any government entity anywhere on Earth changes its mind about what zone they're in and when, the IANA needs to reissue the TZDB. Then every OS and platform vendor needs to patch up to a new TZDB. Just for laughs, Java seems to have its own TZDB so in general your OS and application layer might disagree about zones.
This is all okay for most users who just get an automated OS push, but some vendors operating national networks that need to do some things in localtime need to upgrade their platforms and do acceptance testing every time.
And then there's bugs.
Just for example about the variations, here's a recent TZDB change, seems Fiji is rejiggering their dates only a month away. See the archives for many more.
https://mm.icann.org/pipermail/tz-announce/2020-October/0000...
https://www.iana.org/time-zones