Better Programming

Advice for programmers.

Follow publication

You're unable to read via this Friend Link since it's expired. Learn more

Member-only story

Time Zones for Software Developers

Bikash Paneru
Better Programming
Published in
11 min readDec 25, 2020
hand holding a small old-fashioned manual alarm clock
Photo by Lukas Blazek on Unsplash

Working with time zones can be rough! In fact, this article was inspired by the problems that I had with them. I finally decided to bite the bullet and do some extensive research to properly understand them. I found that they get much easier to work with when you understand the basics. This is my attempt, by putting all the basics in one place, to help anyone else who is struggling with time zones. There are also solutions to some common problems at the end.

Coordinated Universal Time (UTC): The Bread and Butter

This is the first thing we need to understand before looking at time zones. UTC is the world’s time standard. This means that the time in every other part of the world is determined using UTC. In fact, the local time anywhere in the world can be obtained by adding or subtracting an offset from UTC.

For example, the time in Nepal, where I live, can always be obtained by adding five hours and 45 minutes to the current time in UTC. So the time here can be expressed as UTC+05:45.

UTC itself is the time in the region of the Earth where the longitude is 0 degrees. This region is known as the prime meridian. People often confuse UTC for a time zone, but UTC itself is not a time zone.

What Is a Time Zone?

The Earth rotates approximately 15 degrees per hour, so the world was divided into 360/15 = 24 time zones. The idea was that time in each 15-degree interval would always be the same.

The time in the time zones to the left of the prime meridian can be obtained by subtracting the offset from UTC. Similarly, the time in the time zones to the right can be obtained by adding the offset to UTC. The offset in each of the regions differs from the adjacent region by exactly one hour.

These regions can also be referred to by a name. For example, the time zone which observes no offset from UTC is called GMT (Greenwich Mean Time). Another example is EST (Eastern Standard Time) which is the time zone with an offset of -5.

All of this is more clearly illustrated in the picture below.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Bikash Paneru
Bikash Paneru

Written by Bikash Paneru

Technology for Passion, Noodles for Hair and Junk for Food. https://mrdivinemaniac.github.io/

Responses (1)

Write a response