It's that time of year again. Daylight saving time started in the United States this week. And incidentally, the US Senate just approved the Sunshine Protection Act, a proposal to make daylight saving time permanent all year round. If signed into law, that would mean that US citizens would never again "fall back" or "spring forward" by an hour twice a year. Hallelujah!

Ask any programmer, and they'll tell you that time is tricky. I've had co-workers wake up at 2am every November to pause their programs for an hour and avoid issues from the "duplicate" hour, and I've laughed to tears over Tom Scott's great video on the insanity of tracking time around the world. How did we ever get into this predicament?

The history

People used to tell time by looking at the sun, setting their local noon to whenever the sun was directly overhead in the sky. Unfortunately, once the first transcontinental railroads were built, train companies struggled to keep accurate timetables. Train stations on a single line could be spread out across 75 different local times! So to simplify matters, Congress passed the Standard Time Act of 1918, dividing the United States into five time zones.

The act included a daylight saving time provision. It was based off the European equivalent, British Summer Time, where the time change was used to save energy during World War I. (Fun fact: During World War II, the UK used British Double Summer Time, where clocks were turned ahead two hours instead of the usual one. As before, this was also introduced to save energy.) However, US farmers protested the daylight saving time component, and the clause was removed a year later.

After the protests, many states reintroduced the time changes. They chose their own start and end dates, and once again, tracking time became difficult. In 1966, Congress stepped in and passed the Uniform Time Act to standardize those start and end dates, but they also forbade the permanent use of daylight saving time year-round. Naturally, some states objected to this and passed their own laws to disregard the time changes. And so today, most of the United States observes daylight saving time, but Hawaii and most of Arizona and Indiana do not.

The confusion

The problem with man-made constructs like time is that they're subject to the whims of those in power. Daylight saving time has undergone many a change in the last 50 years, and the changes haven't always been predictable.

For example, the Emergency Daylight Saving Time Energy Conservation Act of 1973 was a two-year experiment for the United States to run on daylight saving time year-round instead of changing the clocks twice a year. Unfortunately, the experiment ended early due to complaints from northern states about the dark winter mornings.

In 2005, the Energy Policy Act extended daylight saving time by 4 weeks, starting it in March instead of April and ending it in November instead of October. The airline industry cried that the changed schedule would cost them millions, and schools worried about young students waiting for buses in the dark. The changes also affected neighboring countries, so Canada and Mexico eventually passed laws to sync their time zones with those of the United States. Of course, European countries still change their clocks on their own calendar. No big deal, unless you work at an international company with employees located around the world.

The future

The other problem with man-made constructs is that they don't always account for edge cases. We think of a day as being 24 hours long, but due to daylight saving time, it's possible for a day to be 23 hours or 25 hours long instead. And why should a programmer have to deal with that?

Actually, it's more important than you might think! As we continue to explore the space frontier, concepts like 24 hours in a day or 365 days in a year may no longer make sense. Once humans begin colonizing Mars, units of time that were defined only for Earth become strange. Martian solar days are 24 hours, 37 minutes, and 35 seconds long, so it isn't realistic to expect Martians to follow an Earthling's time standards.

All kinds of proposals exist to handle the time differences. Maybe Martian minutes should be longer than those on Earth. Or maybe Martians can add leap hours and leap minutes to keep in sync with time on Earth. And wait, how does planet-to-planet latency (spanning anywhere from 4 to 24 minutes) further complicate time tracking?

So yes, while daylight saving time as an energy-saving strategy may be unfounded, the difficulties around time that it introduces are both interesting to think about and relevant for the future. I only hope that I don't have to be the programmer who implements it.