How railway timetables became Unix timeHow railway timetables became Unix time<br>Time and computer science 2022.02.22<br>KO | ENThe sun’s timeThe atom’s timeThe operating system’s timeThe application’s time<br>Dealing with time in computer science is a fairly grueling task. Software engineers suffer in particular from the gap between the time systems we intuitively understand in daily life and the time systems we never consciously notice. In this article I want to look at time systems like solar time and atomic time, and explain how computers handle time.The sun’s time<br>Stanford University Libraries (CC0)Up until the early 19th century, each region used its own local mean time (LMT). Because local mean time is a system that takes the moment the sun reaches its highest point in a given place as its reference, the time in use differed by longitude, by region, by city, and by village. Traveling from London to Oxford, for instance, set the clock forward by five minutes; going to Leeds set it forward by six. Even so, it caused no trouble. The horses pulling carriages and the wind driving ships were slow enough that a difference of a few minutes didn’t matter.But once the steam engine appeared and railways were laid to connect the regions, travel time shrank dramatically and accurate time became important. If a train that leaves London at 8 o’clock sharp arrives in Oxford exactly an hour later, by Oxford’s clock it arrives at 8:55, not 9:00. There’s a five-minute gap from the engineer’s clock, which is set to London time. If the train sets off again for London at 9:10 by the engineer’s clock, the passengers in Oxford miss it by five minutes. A passenger could miss a train over a few minutes’ difference, and an engineer could collide with another train over a few minutes’ difference. In 1840 the Great Western Railway adopted London’s Greenwich Mean Time (GMT) across all of its stations and timetables, and in 1847 the Railway Clearing House[1] recommended that every railway company in Britain adopt GMT as soon as possible.[2] Eventually GMT came to be used as standard time throughout Britain.GMT is the time observed at the Greenwich Observatory. The moment the sun reaches its highest point over Greenwich is set as noon, and the span from then until the sun reaches its highest point the next day is divided into 24 hours. The Earth, then, rotates 360 degrees over those 24 hours, turning 15 degrees per hour. So the meridian passing through Greenwich is taken as the reference for 0 degrees longitude, the prime meridian, and dividing the Earth into 15-degree slices puts a one-hour difference at every 15 degrees of longitude. Regions divided up on this basis are called time zones: London sits at GMT+0, Berlin at GMT+1, an hour ahead of London, and Seoul at GMT+08:30, eight and a half hours ahead. Several imperial powers wanted the meridian through their own capital to be the prime meridian, but GMT, already in use in many places, became the reference for Universal Time.The reason for the word “mean” is that it doesn’t take exactly 24 hours from the moment the sun reaches its highest point today to the moment it does so tomorrow. The Earth orbits in an ellipse, the sun isn’t at the center of that ellipse, the Earth’s orbital speed increases as it nears the sun and slows as it moves away, and the Earth’s axis is tilted 23.5 degrees. So if you use apparent solar time, which always takes the moment the sun reaches its highest point as exactly noon, the length of a day varies by a few seconds every day. The system that averages apparent solar time to correct for this error is called mean time. In other words, saying a day is 24 hours means a day is on average 24 hours. I described GMT earlier as if it were observed as apparent solar time, but note that it’s actually a mean time derived from apparent solar time.The atom’s time<br>UK National Physical Laboratory (CC0)Time systems based on the sun, like GMT, are collectively called solar time. In the 20th century, though, we learned that the Earth’s rotation speed is irregular because of tidal forces. Until then, the second had been defined as 1/31556992 of the 31,556,992 seconds it takes the Earth to orbit the sun once, which means that definition was irregular. Then in 1955 an atomic clock appeared that used caesium-133, the only stable isotope of caesium (55Cs_{55}\text{Cs}55Cs), and in 1967 the General Conference on Weights and Measures (CGPM) defined one second as the time it takes the electromagnetic wave emitted and absorbed by a caesium-133 atom to oscillate 9,192,631,770 times.[3] A time system based on the atom like this is called atomic time, and the International Atomic Time (TAI) standard is set from the atomic time measured by hundreds of atomic clocks around the world.Because the basis for the second changed from solar time to atomic time, GMT, the reference for Universal Time, also needed to be reconsidered. So Coordinated Universal Time (UTC), based on atomic time, came to...