The Earth's rotation is slowing. Tidal friction, glacial melting, and other factors cause our planet to take slightly longer to complete each rotation. This creates a problem: atomic clocks keep perfect time, but the Earth does not.
The solution? Add (or theoretically remove) a second occasionally to keep UTC aligned with astronomical time. These are leap seconds.
How Leap Seconds Work
When the International Earth Rotation and Reference Systems Service (IERS) determines that UTC has drifted too far from astronomical time, they announce a leap second. This typically occurs on 30 June or 31 December at 23:59:59 UTC.
Instead of the clock going from 23:59:59 to 00:00:00, it goes:
23:59:59 23:59:60 ← leap second 00:00:00
Yes, the minute has 61 seconds. This is valid according to ISO 8601, but many systems do not handle it correctly.
Why Leap Seconds Break Things
Leap seconds have caused notable outages:
- 2012 — Reddit, Gawker, and LinkedIn experienced outages due to a Linux kernel bug triggered by the leap second.
- 2015 — Twitter and Instagram had issues when the leap second caused system clocks to report impossible times.
- 2017 — Cloudflare reported that some DNS servers briefly returned dates in 1970 due to leap second handling.
Leap Second Smearing
Google and other major cloud providers use “leap second smearing” — instead of adding a full second, they slow their clocks very slightly over a 24-hour period. The leap second is “smeared” across the day.
This avoids the 23:59:60 problem but means that during smearing, Google's clocks are technically wrong by tiny amounts. For most applications, this is acceptable.
The End of Leap Seconds
In 2022, the General Conference on Weights and Measures voted to abandon leap seconds by 2035. After that date, UTC will be allowed to drift from astronomical time by up to one minute before any correction is made (likely over decades rather than with discrete seconds).
Leap seconds were a elegant solution to a coordination problem. But in a world of distributed systems, adding a second to every clock on Earth at the same instant creates more problems than it solves.
For now, if you maintain systems that care about subsecond precision, be aware that 30 June and 31 December may contain surprise seconds.