HackerTube

The Problem with Time & Timezones - Computerphile

Computerphile12 HN recommenders · recommended in 12 months, 2014–2026
YouTube
explainer · general · evergreen · 2014–2026 on HN

Tom Scott explains for Computerphile why handling time and timezones in code is so hard, walking through a simple web app that computes how long ago something happened. It covers the quirks of timezones and calendars and ends in an exasperated rant.

It is the go-to funny, accessible explanation of why you should never implement datetime handling yourself, linked in nearly every timezone thread.

12 comments from Hacker News

@yboris2021-02 · in “Timezone Bullshit”

Obligatory post to Computerphile episode about Timezones - a must watch for developers just starting out with Timezones ▶ this video

Strongly recommends View on HN
@tehmaco2015-01 · in “A positive leap second will be introduced at the end of June 2015”

This will probably resonate with people here[1]. A brilliant video by Tom Scott for Computerphile, where he starts to explain what coding timezones correctly is like and by the end of it is in full polite-mini-rant-mode :D [1] ▶ this video

Strongly recommends View on HN
@wolrah2026-03 · in “The surprising whimsy of the Time Zone Database”

That might work for the current form of the country-specific time zones officially acknowledged by countries that exist in TLD form, but the tz database contains many more current time zones more importantly piles of historical time zones. Representing just the historical forms of currently recognized time zones in DNS would be a mess, without even getting in to those that are not associated with a country that currently exists and has a TLD. edit: This is a great video explaining a lot of the reasons why time zones are nowhere close to as straightforward as you may think: ▶ this video

Recommends View on HN
@birdman31312022-10 · in “Australia's weird little time zone (2008)”

I have to toss this classic video on the issues with timezones and programming. The sheer amount of growing exasperation as the video goes is hilarious. ▶ this video The Problem with Time & Timezones - Computerphile / Tom Scott

Recommends View on HN
@jonathansampson2021-12 · in “Goodbye Brave”

Great question! Dates and times are one of the most loathed obstacles in writing software that needs to work a particular way across millions of devices situated all across the globe in different regions and time zones. In our case, we had a bit of code that aimed to measure the time until midnight/tomorrow. But when clocks change at midnight (jumping forward or backward), you can wind up with days that appear to be longer than 24 hours in length. And when a day is more than ~24hr in length, you wind up with unexpected answers to seemingly simple math equations. A bit of logic, responsible for setting up a timer, wound up scheduling numerous timers when our 'How long until tomorrow' code began returning negative numbers. That set of unintended timers locked-up the application itself. You can see our issue for the behavior here: link . For 10 minutes of anxiety, check out 'The Problem of Time & Timezones' from Tom Scott of Computerphile: ▶ this video . It's a fantastic summary of the issues programmers face when dealing with time :) Sampson (Brave Team)

Recommends View on HN