Why leap seconds exist (and why they're being abolished)
The Earth doesn't spin on a schedule, but our clocks do. Leap seconds tried to bridge the two — and broke the internet doing it.
Why it exists
For most of human history “a second” was a fraction of a day, and a day was however long it took the Earth to spin once. That definition has a problem: the Earth is a wobbly, sloshing, slowing-down rock, not a metronome. Tides drag on it, the core moves, big earthquakes redistribute mass, the atmosphere shifts with the seasons. The length of a day jitters by milliseconds and, on a long enough timescale, gets gradually longer.
In 1967 the second was redefined as a fixed number of oscillations of a caesium-133 atom — exactly 9,192,631,770 of them. Suddenly “second” no longer meant “1/86400 of a day.” It meant a physical interval that atomic clocks could measure to absurd precision. Astronomical time (UT1) and atomic time (TAI) started to drift apart, because the Earth kept slowing down while the caesium kept ticking exactly the same.
The leap second was the compromise. Starting in 1972, UTC was defined as TAI minus a whole number of seconds, with an extra second occasionally inserted (almost always on June 30 or December 31) to keep UTC within 0.9 seconds of UT1. Civil time would stay aligned with the sun; atomic time would keep its precision; the leap second was the seam.
Why it matters now
The seam has caused more outages than it has prevented. The famous one: on June 30, 2012, a leap second was inserted, and the Linux kernel’s handling of it caused a thread-deadlock bug to fire across half the internet. Reddit, LinkedIn, Mozilla, Qantas’s check-in system — all hit by the same kernel issue or related ones in NTP daemons. A 2015 leap second triggered another round, smaller but still real.
The problem is that a leap second is a kind of time event most software doesn’t know how to express. UNIX time is “seconds since 1970, ignoring leap seconds.” When a leap second arrives, the system either repeats a second (23:59:59 happens twice), pretends it didn’t happen, or “smears” it — slowing the clock for a few hours so the extra second is absorbed gradually. Google has done leap smearing publicly since 2011, AWS since 2017. There is no single right answer, which is itself the bug: different clouds, different OS versions, and different NTP configs disagree by up to a second on what time it actually is during the smear window.
In November 2022, the CGPM voted (Resolution 4 of the 27th CGPM) to abolish leap seconds no later than 2035. UTC will be allowed to drift from UT1, and the gap will be patched in some other, larger, less-frequent way to be decided. The internet won.
The short answer
leap second = atomic time + an occasional patch to keep civil time aligned with the Earth's rotation
A leap second is an extra second inserted into UTC every few years to compensate for the Earth’s gradual slowing. It exists because we redefined “second” as an atomic unit but still wanted clocks to roughly agree with the sun.
How it works
Three time scales, layered:
- TAI — atomic time. Counts caesium oscillations. Never adjusted. Monotonic, predictable, unphysical for everyday use because it doesn’t track sunrise.
- UT1 — astronomical time. Derived from very-long-baseline interferometry observations of distant quasars; tracks the Earth’s actual rotation. Wobbles unpredictably.
- UTC — civil time. Defined as
TAI − N, whereNis the cumulative count of leap seconds. As of 2026,N = 37. UTC is what your phone, your servers, anddate(1)are nominally telling you.
The decision to insert a leap second is made by the IERS, usually about six months in advance, based on observed UT1 drift. Notably, every leap second so far has been a positive one (an extra second). The Earth has actually been spinning slightly faster than expected since around 2020, and serious discussion has happened about the possibility of a negative leap second — a second that gets deleted. No software has ever handled that case in production. That alone is a strong argument for the 2035 abolition.
The mechanics on a Linux box on leap-second night, classically:
23:59:59 UTC
23:59:60 UTC <- the leap second
00:00:00 UTC
23:59:60 is a legal timestamp in RFC 3339. It is not legal in most database TIMESTAMP types, in most programming-language datetime libraries, or in time_t. Hence the smear: instead of inserting a literal extra second, you spread its insertion across (say) 24 hours, running every clock 1/86400 slow. No discontinuity, no :60, but for that window your clock is wrong by up to half a second relative to UTC — and wrong in a different direction than your neighbor’s clock if they use a different smear window.
I don’t have a clean public number for total industry cost of leap-second incidents, and most outage post-mortems frame the bug as “kernel issue” rather than “leap second issue” — so the cultural memory is fuzzier than the engineering record. The pattern that’s clear: leap seconds are a rare, untestable code path, and rare-untestable is exactly where bugs hide.
Famous related terms
- TAI —
TAI = caesium oscillations counted since 1958— atomic time, never adjusted, the bedrock under everything else. - UT1 —
UT1 = mean solar time at Greenwich— what an idealised sundial would say. Tracks Earth’s rotation directly. - UTC —
UTC = TAI − leap seconds— civil time. Whatnow()is supposed to give you. - Leap smear —
leap smear ≈ stretch one second across many hours so no client sees :60— Google’s and AWS’s workaround. - Monotonic clock — see /posts/systems/monotonic-vs-wall-clock-time/ for why you almost never want wall time for measuring durations.
Going deeper
- IERS Bulletin C — the official leap-second announcements: https://www.iers.org/IERS/EN/Publications/Bulletins/bulletins.html
- Resolution 4 of the 27th CGPM (2022) — the abolition vote: https://www.bipm.org/en/cgpm-2022/resolution-4
- Google’s 2011 leap-smear post — the design that the rest of the industry mostly copied.