Skip to content
Swizec Teller - a geek with a hatswizec.com

Why don't computers understand timezones?

Everyone who sometimes changes their timezone has probably had this problem before.

You're planning a trip to a 9 hour distant timezone. Let's say it is a business trip. To be more productive you schedule some meetings in advance and put them in your calendar. Whichever calendar will do, they all have this problem.

Timezoneshi02jd
Timezones

Then you hop on a plane. Land. Dutifully tell your computer what timezone you are in. Maybe it magically figures this out on its own.

Voila!

The meeting you so carefully planned for tomorrow at 2pm is now marked in your calendar as tomorrow morning at 5am.

Crap. It only took you ten pingpong emails to arrange this. Sure, 5am is probably not when you scheduled it, but what was the time again? Searching through emails for "meeting at 2pm" won't help much either.

You simply can't remember when you scheduled the meeting. You schedule too many every week to keep track in your head. You wouldn't even need a calendar if this wasn't the case anyway!

Now what?

It might not even have moved to 5am but something reasonable. Now you'll unknowingly show up at the wrong time and blow that fucking awesome deal.

Your calendar is correct though ... in a way.

The meetings are still exactly when you scheduled them. They are still attached to the exact perfect absolute time you planned them for. But this isn't what you meant is it? You wanted the meeting to be at "2pm whenever 2pm is for me on the day this meeting is happening".

To date I have yet to find a single application on a computer that would understand the idea that I _don't care about timezones_. Yes, timezones are a useful concept. To me personally they are meaningless 90% of the time. When I say I expect something to happen on a particular time ... I expect it to fucking happen then! Not at some absolute nebulous concept of time that holds no meaning for me.

It is understandable that programmers the world over would get this wrong. Before I did any traveling I found timezones to be perfectly reasonable the way everyone implements them.

You translate everything to UTC time when it is stored in the database, then offset it back to the appropriate timezone for whichever user is looking at it. It's something the View cares about. Core logic doesn't need to know or care. It's only a matter of display.

This is an unsolvable problem. Logically.

The concept of time as an absolute, with timezones as mere offsets the display cares about, makes perfect sense. And in many cases is the only correct answer! Think of timestamps on tweets, or forum posts, of course I want those to display relative to me - as an absolute time.

But when scheduling stuff it seems my (our?) instinctive understanding of time is a bit different. Suddenly I no longer care about absolute time and making certain everyone in the world sees the correct time. I only care that when I fly to a different timezone, _the event stays in its fucking place!_

It seems we have reached an impass.

How are computers supposed to handle timezones well, when their users (the arbiters of truth and properness) have such different conceptions of time in different contexts?

But even some messages, the only place it seems where absolute time is of any use, lose a great deal of information when the time is translated into "my" timezone. There will often be "good morning" tweets when I'm just about to go to bed. Things like that would make a lot more sense if the time on a tweet at least made any mention of when, relative to the poster, it was made.

So maybe we need to start implementing our software so it displays both absolute time and the originator's local time? And in the case of schedulable events only care about relative time?

The latter especially has big connotations for displaying the same event to people in different timezones. For this I don't have a good solution right now ... very open to suggestions by the way.

Or maybe I'm just imagining this problem and people simply aren't switching timezones often enough to make solving this problem worthwhile.

Did you enjoy this article?

Published on August 25th, 2011 in annoying, quirks, software, timezones, Uncategorized

Learned something new?
Want to become a high value JavaScript expert?

Here's how it works 👇

Leave your email and I'll send you an Interactive Modern JavaScript Cheatsheet 📖right away. After that you'll get thoughtfully written emails every week about React, JavaScript, and your career. Lessons learned over my 20 years in the industry working with companies ranging from tiny startups to Fortune5 behemoths.

Start with an interactive cheatsheet 📖

Then get thoughtful letters 💌 on mindsets, tactics, and technical skills for your career.

"Man, love your simple writing! Yours is the only email I open from marketers and only blog that I give a fuck to read & scroll till the end. And wow always take away lessons with me. Inspiring! And very relatable. 👌"

~ Ashish Kumar

Join over 10,000 engineers just like you already improving their careers with my letters, workshops, courses, and talks. ✌️

Have a burning question that you think I can answer? I don't have all of the answers, but I have some! Hit me up on twitter or book a 30min ama for in-depth help.

Ready to Stop copy pasting D3 examples and create data visualizations of your own?  Learn how to build scalable dataviz components your whole team can understand with React for Data Visualization

Curious about Serverless and the modern backend? Check out Serverless Handbook, modern backend for the frontend engineer.

Ready to learn how it all fits together and build a modern webapp from scratch? Learn how to launch a webapp and make your first 💰 on the side with ServerlessReact.Dev

Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com

By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️