Leap Seconds Explained: How UTC Stays Aligned with Earth’s Rotation
Leap seconds are one-second adjustments inserted into UTC to keep atomic-clock time aligned with the slowing rotation of the Earth. They have crashed major systems and are scheduled to be abolished by 2035. This guide covers what they are, how Unix time handles them (mostly by ignoring them), and the practical patterns systems use to stay safe.
What is a leap second?
A leap second is an extra second added to UTC to keep it within 0.9 s of UT1 — astronomical time, which is based on Earth’s rotation. The Earth’s rotation is irregular and slightly slowing on long timescales, so atomic UTC and rotational UT1 drift apart and have to be re-aligned.
- 27 positive leap seconds have been inserted between 1972 and the most recent (2017-01-01)
- No negative leap second has ever occurred, but one is theoretically possible if Earth speeds up
- IERS Bulletin C announces upcoming leap seconds at least six months in advance
- Inserted at the very end of a UTC day (23:59:60), typically on June 30 or December 31
Why leap seconds exist
UTC was redefined in 1972 to be a hybrid: the SI second (atomic), kept within a fraction of a second of UT1 (astronomical) by occasional leap-second insertions. The goal was to keep clock time and solar time roughly aligned without committing to either pure system.
- TAI: International Atomic Time, a pure SI-second count with no leap seconds (currently 37 s ahead of UTC)
- UT1: rotational time, based on Earth-orientation observations
- UTC: the hybrid — atomic ticks, periodically nudged to track UT1
- Without leap seconds, UTC and the sun would drift by ~1 minute per century
Leap seconds and Unix time
POSIX Unix time is defined to ignore leap seconds: every Unix day is exactly 86,400 seconds. When a leap second occurs, different systems handle it differently — none of them increment the Unix timestamp by an extra second.
- POSIX strict: the second number repeats — 23:59:59 happens twice, both mapping to the same Unix timestamp
- Linux kernel pre-2012: implemented strict POSIX; many bugs surfaced (Java, MySQL, Hadoop hangs)
- Linux kernel modern: applies the adjustment via clock_settime(); some implementations smear over a window
- Smearing: spread the extra second over hours or a day so no individual second is repeated
Leap smearing
Most large public NTP services no longer pass leap seconds through to clients verbatim. They smear: the extra second is spread over a window so client clocks advance very slightly faster (or slower for a negative leap) than UTC during the window.
- Google: 24-hour smear centered on midnight UTC; ~11.6 µs/s adjustment
- AWS: 24-hour smear via Amazon Time Sync Service
- Facebook: 17-hour smear
- Microsoft: 24-hour smear since 2018
- Smearing means client wall clocks differ from strict UTC during the smear window — fine for application use, not for high-precision timing
The 2035 abolition
The General Conference on Weights and Measures (CGPM) voted in November 2022 to eliminate leap seconds from UTC by 2035 at the latest. The plan replaces the ±0.9 s UT1 tolerance with a much larger one, effectively letting UTC drift from solar time over many decades.
- 2022-11: BIPM/CGPM resolution to abolish leap seconds by 2035
- 2023-11: ITU-R WRC-23 formally endorses the metrology decision
- After abolition, UTC will become a pure atomic time scale aligned with TAI by a fixed offset
- Implementations have until 2035 to phase out leap-second handling code paths
Leap seconds FAQ
- How many leap seconds have there been?
- 27 positive leap seconds have been inserted into UTC between 1972 and 2017-01-01. None have been inserted since. No negative leap second has ever occurred.
- Will Unix timestamps include leap seconds after 2035?
- No. Unix time has never counted leap seconds and never will. After abolition, UTC itself stops adding them, so Unix time and UTC will simply remain aligned.
- Why did Reddit and Cloudflare crash on leap second days?
- Linux kernel and Java libraries had bugs that triggered when 23:59:60 occurred — typically infinite loops, lock contention, or NaN math from a "negative second" in some code paths.
- What is the current TAI−UTC offset?
- 37 seconds. That is 27 leap seconds (since 1972) plus a 10-second initial offset established when UTC was defined.