The Surprisingly Rich History of Timekeeping
Before clocks, time was local. Noon was when the sun was highest, and that happened at a different moment for every town a few miles east or west. This did not matter when the fastest communication wa
Before clocks, time was local. Noon was when the sun was highest, and that happened at a different moment for every town a few miles east or west. This did not matter when the fastest communication was a horse, but it became a crisis when trains arrived. If the 2:15 from London to Bristol used London time and Bristol used its own time (10 minutes behind), schedules were meaningless. In 1840, the Great Western Railway forced all its stations onto "railway time" — London time — and the modern era of standardized time began.
The Sun and the Shadow
The earliest timekeeping devices were sundials, appearing in Egypt around 1500 BCE. They measured apparent solar time — the actual position of the sun in the sky. This is intuitive but irregular: solar days vary in length throughout the year because Earth's orbit is elliptical and its axis is tilted. The difference between solar time and clock time can be as much as 16 minutes, a phenomenon described by the equation of time.
Water clocks (clepsydra) solved the regularity problem by measuring time as a steady flow of water from one vessel to another. The Greeks and Romans used them in courtrooms to limit speeches — the origin of "your time is running out." The Chinese engineer Su Song built an enormous water-clock astronomical tower in 1088 that tracked the movements of stars and planets. It was dismantled by invaders 40 years later.
The Mechanical Revolution
The first mechanical clocks appeared in European monasteries around 1280, driven by falling weights. They had no minute hand — they only struck the hours, and not very accurately. A good 14th-century clock lost about 15 minutes per day.
Christiaan Huygens changed everything in 1656 with the pendulum clock, reducing error to about 15 seconds per day. The principle was elegant: a pendulum's period depends almost entirely on its length, not on the width of its swing. Gravity provides free, consistent energy. The pendulum clock was so superior to its predecessors that it remained the most accurate timekeeper for nearly 300 years.
The Longitude Problem
Finding your longitude at sea requires knowing the time at a reference point (like Greenwich) and comparing it to local solar time. Every 15 degrees of longitude corresponds to one hour of time difference. But pendulum clocks do not work on ships — the rocking throws off the pendulum.
John Harrison, an English carpenter with no formal education, spent 31 years building marine chronometers that could keep accurate time at sea. His H4, completed in 1761, lost only 5 seconds on a 47-day voyage to Jamaica. It was one of the most important inventions in naval history, enabling reliable navigation and safe global trade.
The Quartz Era
In 1927, Warren Marrison built the first quartz crystal oscillator clock at Bell Labs. Quartz crystals vibrate at a precise frequency when electrical current is applied — a property called piezoelectricity. A typical quartz watch crystal vibrates 32,768 times per second (2^15, chosen because binary division is simple electronics). Quartz clocks are accurate to about 15 seconds per month, a thousand times better than the best mechanical watches.
The quartz revolution democratized accurate timekeeping. Before quartz, a precise clock was expensive. After the Seiko Quartz Astron launched in 1969, accurate time became available to everyone for a few dollars.
Atomic Precision
Modern atomic clocks measure time by counting the oscillations of cesium-133 atoms, which vibrate at exactly 9,192,631,770 cycles per second. One second is defined as that many cesium oscillations. The best atomic clocks lose about one second every 300 million years.
This precision matters for GPS (a 1-microsecond timing error produces a 300-meter position error), financial trading (exchanges timestamp orders in nanoseconds), and fundamental physics (general relativity predicts that clocks run faster at higher altitudes, and atomic clocks are precise enough to measure this — a clock on a table runs faster than one on the floor).
The Software Problem
For software engineers, time is a minefield. Time zones are political, not geographic — China spans five geographic zones but uses one. Daylight saving time changes are announced by governments with sometimes months of notice. Leap seconds are inserted irregularly. The IANA time zone database, which every computer relies on, is maintained by a mailing list of volunteers.
This is why scheduling software is hard, why CronPing exists (because cron jobs that depend on time are fragile), and why every developer eventually learns to store timestamps in UTC and convert only at display time. Four thousand years of timekeeping innovation, and the practical advice is still: just use UTC.