The Problem with Time & Timezones - Computerphile
Channel:Computerphile · Length:10:12 · Published:2013-12-30 · Views:4409354
Summary
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.
Why HN recommends it
It is the go-to funny, accessible explanation of why you should never implement datetime handling yourself, linked in nearly every timezone thread.
a must watch for developers just starting out with Timezones — HN, 2021
Python, Ruby & scripting languages · Software (other)
Subtitles (excerpt)
Sooner or later, every programmer has to deal with time zones. And I can't really offer much advice here; I can offer a cautionary tale. I can tell you why you really should never, ever deal with time zones if you can help it. Let's imagine that someone has built an application that lets you calculate how many seconds something is in the past. You type in a date and a time, it gives you the number of seconds. And they look at that and think "OK, that kind of works for me..." "But let's add a little box that lets you change the time zone" So if you're comparing between now in New York and five days ago in London, you can work that out. And that's fine - the little drop down lets you change which hour forward or backward of Greenwich you are. Brilliant. Sooner or later, after it gets a bit popular, they'll get a call from Australia. And Australia will say "G'day ma--" -- I'm not gonna try and do accents. I just shouldn't do accents. Australia will say "Hello!" "By the way, we're 9½ hours ahead of Greenwich." And the programmer will go "really?" "Yeah, 9½ hours." "OK, I'll add a special case for you. That's fine." A little bit later, someone will call from Nepal. And they'll say "Hello. We're 5¼ hours ahead of Greenwich."
On Hacker News
Obligatory post to Computerphile episode about Timezones - a must watch for developers just starting out with Timezones [VIDEO] — yboris, 2021-02
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] [VIDEO] — tehmaco, 2015-01
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… — wolrah, 2026-03
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. [VIDEO] The Problem with Time & Timezones - Computerphile / Tom Scott — birdman3131, 2022-10
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 da… — jonathansampson, 2021-12
Related videos
- THE DUMBEST BOY ALIVE. PRETTY GOOD, EPISODE SIX. · Jon Bois · 18:12
- Howard Payne & Deviant Ollam - This Key is Your Key, This Key is My Key · DeviantOllam · 52:13
- Elevator Hacking: From the Pit to the Penthouse · DeviantOllam · 1:55:53
- How English sounds to non-English speakers · Brian and Karl · 4:05
- Debt: The First 5,000 Years | David Graeber | Talks at Google · Talks at Google · 1:21:10
- Plover: Thought to Text at 240 WPM · Next Day Video · 34:21
- Riding the Booster with enhanced sound · Michael Interbartolo · 8:32
- Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich · Confreaks · 53:21
- The spelled-out intro to neural networks and backpropagation: building micrograd · Andrej Karpathy · 2:25:52
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework · Видео с мероприятий {speach! · 49:55
- RailsConf 2014 - All the Little Things by Sandi Metz · Confreaks · 38:47
- What the heck is the event loop anyway? | Philip Roberts | JSConf EU · JSConf · 26:52
- How To Design A Good API and Why it Matters · Google TechTalks · 1:00:19
- RailsConf 2016 - Turbolinks 5: I Can’t Believe It’s Not Native! by Sam Stephenson · Confreaks · 37:37
- Brian Goetz - Stewardship: the Sobering Parts · ClojureTV · 1:03:30
- Ruby Midwest 2011 - Keynote: Architecture the Lost Years by Robert Martin · Confreaks · 1:06:38