Icon!

I love my current job as an engineering manager at Canonical. It’s been a blessing to our family that I can work from my house. I get to do just enough traveling to places I likely would have never gone on my own to scratch my travel itch. And I get to work on a product that I love (Ubuntu Server) with people I love that are just some of the brightest, friendliest and fun people in the industry.

My wonderful team at Canonical speaks 5 different languages natively and spans 6 “standard” timezones. It’s such a cool experience to work with people from many different cultural backgrounds.

As the person who has the pleasure of managing this team, one of my responsibilities is knowing when we can schedule things like standups or team meetings where everyone can attend.

Simple, just memorize these timezones.

Timezones!

Let’s look at those 6 “standard” timezones, those are more richly referred to by their IANA tz database zone names, which carry historical information as well as the current state of timezones in their definitions. My team’s time zones:

  • Mountain: America/Denver
  • Central: America/Chicago
  • Eastern: America/New_York
  • Eastern: America/Toronto
  • Brazilian: America/Sao_Paulo
  • British: Europe/London
  • Central European: Europe/Rome
  • Central European: Europe/Berlin

If you can map where the person lives to their IANA zone name, you know what “time” people that live in that area think it is now, or even at some point in the past 100 years or so (timezones weren’t really put into widespread use until trains let us travel across distances so quickly, and on schedules, that it mattered to know; before that people just went by the local solar time in their city).

So what’s the problem? Maybe you don’t have this problem, but for me, timezone math is hard. It’s simple addition and subtraction, why should it be hard? I suspect there are a few reasons for this:

  • My sense of time is very focused on myself and the sunrise/light here.
  • When I do time calculations in my head like “3 hours from now” or “2 hours ago”, I don’t do them as integer math problems, but instead somewhat visually - like adding or removing beans from a bowl. So, the question “What time was it 3 hours ago in Germany”, makes me first have to get the right time in Germany, then do the visual subtraction on the clock. I then can’t easily repeat that for “What about Brazil in the summer?”
  • 12 hour vs 24 hour clocks don’t help.
  • Time resetting to 0 (or 12!) every night at midnight also doesn’t help.

Whatever the cause, the easiest solution I have found is to see times visually on a screen or paper for different timezones. A site worldtimebuddy actually has a very nice layout for this that I really clicked with, and I still use. But, I wanted something that worked from the command line as that is where I spend a lot of my day.

Introducing tzgrid

Do you know what cal is? It looks like this:

$ cal
      May 2018
Su Mo Tu We Th Fr Sa
       1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

I use that a lot, and that’s why the world now has… tzgrid. It’s a very simple python module that’s primary purpose is to display output that looks like this:

Screenshot!

It has a few neat features:

  • Includes database of cities with more than 100,000 people to ease in looking up timezones.
  • Colored output in the terminal
  • Pass in arbitrary time/day or rely on default of ‘now’
  • DST offsets are calculated correctly
  • Workday hours highlighting helps to know when to schedule a meeting.

And the usage of it is very simple:

# Show all configured timezones
tzgrid

# See times in Denver, Seattle and Wellington (New Zealand)
tzgrid Denver Wellington Seattle

Wow, I’m sold, where do I send money?

Put that money back in your pocket sir or madam, it’s free and simple to install. If you are using Ubuntu 16.04 or newer:

sudo snap install tzgrid

Older Ubuntu or non-Ubuntu?

Head over to the snapstore page for tzgrid to see more instructions for older Ubuntu or other linux distros.

Mac or Windows? Well, I think the python module should work, but I haven’t tested. Let me know via github if you try.

More Information