Timezones, and daylight saving - the practice of moving clocks forward by one hour once a year - are a pain. They make it hard to schedule international meetings, plan travel, or may simply cause you to be an hour late for work once a year. For a developer, they are even worse!
The number of things that can trip you up about date and time handling is astonishing. For a quick taster, I’d recommend reading the list of things you believe about time that are likely false. It’s no wonder that even the latest gadgets, such as Google Pixel and Apple Watch still exhibit significant bugs relating to how they handle the passage of time.
Recently I’ve been working on a few libraries for AssemblyScript, a new TypeScript-like language that targets WebAssembly. The library I am currently working on is assemblyscript-temporal, an implementation of TC39 Temporal, the new and vastly improved time API for JavaScript. In implementing the timezone-aware components of that API, I’ve delved deep into the IANA database, the standard reference for timezones, which contains thousands of rules encoded in text files.
While scanning these files I came to realise that timezones were even more complicated than I had originally understood, with the rules in a constant state of flux. I was intrigued to see what patterns might emerge if I could visualise this dataset in its entirety, which led me to come up with this: