What’s Up with Daylight Saving Time? A Brief History and Analysis with Wolfram Language

March 5, 2025

Nick Lariviere, Kernel Developer, Algorithms R&D

FreeformEvaluate["Daylight Saving Time"]

In the next few days, most people in the United States, Canada, Cuba, Haiti and some parts of Mexico will be transitioning from “standard” (or winter) time to “daylight” (or summer) time. This semiannual tradition has been the source of desynchronized alarm clocks, missed appointments and headaches for parents trying to get kids to bed at the right time since 1908, but why exactly do we fiddle with the clocks two times a year?

Why Do We Have Daylight Saving Time in the First Place?

The Sun has been humanity’s primary source for measuring the passage of time for almost all of human history, and, while it’s quite predictable for day-to-day uses, it has always had a few catches that have made timekeeping over longer durations or distances tricky. Unless you happen to live at or near the equator (in which case, you have a nearly constant 12-hour day/night cycle every day of the year), you’re no doubt aware that the length of the day changes throughout the year:

dayLength[where_,when_]:=Sunset[where,when]-Sunrise[where,when]

dayLength[,Today]

dayLength[,(DateObject["Fri 4 Jul 2025", DateObject[{2025,7,4},"Day"]])]

DateListPlot[{#,dayLength[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),#]}&/@DateRange[(DateObject["Wed 1 Jan 2025", DateObject[{2025,1,1},"Day"]]),(DateObject["Thu 1 Jan 2026", DateObject[{2026,1,1},"Day"]]),{5,"Day"}],FrameLabel->Automatic,PlotRange->{All,{5,20}}]

Compare this with the same period of time for a city located close to the equator:

DateListPlot[{#,dayLength[,#]}&/@DateRange[(DateObject["Wed 1 Jan 2025", DateObject[{2025,1,1},"Day"]]),(DateObject["Thu 1 Jan 2026", DateObject[{2026,1,1},"Day"]]),{5,"Day"}],FrameLabel->Automatic,PlotRange->{All,{5,20}}]

This phenomenon gets more pronounced the farther away from the equator one moves:

dayLength[,(DateObject["Sat 21 Dec 2024", DateObject[{2024,12,21},"Day"]])]

dayLength[,(DateObject["Sat 21 Jun 2025", DateObject[{2025,6,21},"Day","Gregorian",0.`]])]

DateListPlot[{#,dayLength[,#]}&/@DateRange[(DateObject["Wed 1 Jan 2025", DateObject[{2025,1,1},"Day","Gregorian",0.`]]),(DateObject["Thu 1 Jan 2026", DateObject[{2026,1,1},"Day"]]),{5,"Day"}],FrameLabel->Automatic,PlotRange->{All,{5,20}}]

Prior to the nineteenth century, most communities used local time determined by the Sun overhead. This variation throughout the year had little impact because time synchronization wasn’t necessary across long distances. You can see what your local solar time would read on a sundial with the SolarTime function:

SolarTime[]

This is pretty close to my current wall clock time (prior to the daylight saving time shift):

TimeObject[]

However, with the progression of industrialization and urbanization favoring the use of mechanical clocks (and in particular the advent of long-distance rail travel and telecommunication), standardized time quickly became a necessity. In 1847, Greenwich Mean Time (GMT) became the British standard, placing noon at the time when the mean Sun reached its zenith in Greenwich. You can see this in the time zone offset information for London, which prior to that time used a local solar time that was a fraction of an hour off from GMT:

TimeZoneOffset[,"GMT",(DateObject["Wed 1 Dec 1847", DateObject[{1847,12,1},"Day","Gregorian",0.`]])]

TimeZoneOffset[,"GMT",(DateObject["Thu 2 Dec 1847", DateObject[{1847,12,2},"Day","Gregorian",0.`]])]

This was, however, not without its problems. By midsummer, some parts of the UK were seeing sunrise near 3am, while sunset was happening at 9pm:

Sunrise[,(DateObject["Mon 21 Jun 1880", DateObject[{1880,6,21},"Day","Gregorian",0.`]]),TimeZone->0]

Sunset[,(DateObject["Mon 21 Jun 1880", DateObject[{1880,6,21},"Day","Gregorian",0.`]]),TimeZone->0]

And because people didn’t simply adjust their daily routines to match the sunlight (because they were now typically working based off of standardized mechanical clocks) this resulted in “wasted” sunlight in the morning while people were sleeping and excess use of energy on artificial lighting in the evening.

People were quick to suggest resetting the standard time throughout the year to more closely align with daylight, but the idea didn’t really catch on until World War I, where it was motivated largely by fuel preservation—and it quickly caught on across Europe. During World War II, the UK actually instituted British Double Summer Time in which the clock was moved forward two hours during the summer to maximize the use of natural light.

Compare the fraction of the summer wherein Glasgow would have a pre-6am sunrise staying on GMT compared with a two-hour shift later:

With[{start=(DateObject["Sat 1 Mar 2025", DateObject[{2025,3,1},"Day","Gregorian",0.`]]),end=(DateObject["Wed 1 Oct 2025", DateObject[{2025,10,1},"Day"]])},DateListPlot[{{#,UnitConvert[Plus@@DateValue[Sunrise[,#,TimeZone->0],{"Hour","Minute"},Quantity],"Hour"]}&/@DateRange[start,end,{5,"Day"}],{{start,(Quantity[6, "h", hours, "Hours"])},{end,(Quantity[6, "h", hours, "Hours"])}},{{start,(Quantity[4, "h", hours, "Hours"])},{end,(Quantity[4, "h", hours, "Hours"])}}},Filling->3->{2},FrameLabel->Automatic]
]

Compare the same shift difference with a pre-9pm sunset over the same time:

With[{start=(DateObject["Sat 1 Mar 2025", DateObject[{2025,3,1},"Day","Gregorian",0.`]]),end=(DateObject["Wed 1 Oct 2025", DateObject[{2025,10,1},"Day"]])},DateListPlot[{{#,UnitConvert[Plus@@DateValue[Sunset[,#,TimeZone->0],{"Hour","Minute"},Quantity],"Hour"]}&/@DateRange[start,end,{5,"Day"}],{{start,(Quantity[21, "h", hours, "Hours"])},{end,(Quantity[21, "h", hours, "Hours"])}},{{start,(Quantity[19, "h", hours, "Hours"])},{end,(Quantity[19, "h", hours, "Hours"])}}},Filling->3->{2},FrameLabel->Automatic]
]

Keeping Up with Daylight Saving Time

There have been many revisions to the schedule for daylight saving time within countries that observe it. There is even an entire database dedicated just to tracking these changing schedules across the globe, which is updated multiple times per year. This includes differing start/stop schedules, changes in regions that observe which shifts and which countries have opted to stop observing daylight saving time shifts altogether (typically choosing to stay on “summer time” when doing so).

Most of Mexico opted to stop observing daylight saving time at the end of 2022, for example:

DateListPlot[{#,TimeZoneOffset["America/Mexico_City",0,#]}&/@DateRange[(DateObject["Jan 2000", DateObject[{2000,1},"Month"]]),(DateObject["Dec 2025", DateObject[{2025,12},"Month"]]),"Month"],Joined->False]

To give this a try with another time zone, LocalTimeZone will identify the name of a time zone based on a location. You can also use TimeZoneConvert to identify the current time in a set location:

LocalTimeZone[(Entity["Sydney", Entity["City",{"Sydney","NewSouthWales","Australia"}], "Entity[\"City\", {\"Sydney\", \"NewSouthWales\", \"Australia\"}]", "city"])]

TimeZoneConvert[Now,(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])]

Changes in daylight saving time schedules, as well as the different dates on which offset changes take place, can lead to scheduling headaches for things like teleconferencing. Take, for example, the difference in time between offices in Chicago, Glasgow and Sydney throughout a period of just six weeks:

EntityValue[{(Entity["America/Chicago", Entity["TimeZone","America/Chicago"], "Entity[\"TimeZone\", \"America/Chicago\"]", "time zone"]),(Entity["Europe/London", Entity["TimeZone","Europe/London"], "Entity[\"TimeZone\", \"Europe/London\"]", "time zone"]),(Entity["Australia/Sydney", Entity["TimeZone","Australia/Sydney"], "Entity[\"TimeZone\", \"Australia/Sydney\"]", "time zone"])},"NextDSTShift"]

With[{range = DateRange[(DateObject["Mon 3 Mar 2025", DateObject[{2025,3,3},"Day"]]),(DateObject["Mon 7 Apr 2025", DateObject[{2025,4,7},"Day"]]),"Week"],cities={(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),(Entity["Glasgow", Entity["City",{"Glasgow","GlasgowCity","UnitedKingdom"}], "Entity[\"City\", {\"Glasgow\", \"GlasgowCity\", \"UnitedKingdom\"}]", "city"]),(Entity["Sydney", Entity["City",{"Sydney","NewSouthWales","Australia"}], "Entity[\"City\", {\"Sydney\", \"NewSouthWales\", \"Australia\"}]", "city"])}},
TableForm[
Outer[{TimeZoneOffset[#2,0,#]}&,range,cities],
TableHeadings->{range,cities}]]

Because of the different onset and end dates for daylight saving time, nearly every week between the beginning of March and the first week of April ends up with some new difference in time zone offset between the three offices. The same thing happens again in the second half of the year when the first two cities transition off daylight saving time and the Australian office transitions back to it:

With[{range = DateRange[(DateObject["Mon 15 Sep 2025", DateObject[{2025,9,15},"Day"]]),(DateObject["Sun 30 Nov 2025", DateObject[{2025,11,30},"Day"]]),"Week"],cities={(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),(Entity["Glasgow", Entity["City",{"Glasgow","GlasgowCity","UnitedKingdom"}], "Entity[\"City\", {\"Glasgow\", \"GlasgowCity\", \"UnitedKingdom\"}]", "city"]),(Entity["Sydney", Entity["City",{"Sydney","NewSouthWales","Australia"}], "Entity[\"City\", {\"Sydney\", \"NewSouthWales\", \"Australia\"}]", "city"])}},DateListPlot[Outer[{#2,TimeZoneOffset[#,0,#2]}&,cities,range],Filling->{1->{2},2->{3}}]]

The US has also proposed (but not yet codified) a transition off of daylight saving time. Only time will tell if this semiannual tradition will continue, but in the meantime, Wolfram Language provides many tools for measuring and managing these time shifts. For more analysis on daylight times across the world, be sure to check out these posts from Wolfram Community:

Visualizing hours of daylight on the summer solstice

Circular sunset/sunrise calendar