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.
Leap seconds in one minute
A leap second is an extra second occasionally added to UTC to keep clock time within 0.9 seconds of UT1 — the time defined by the Earth’s actual rotation. Atomic clocks tick at a perfectly steady rate, but the Earth does not spin at a perfectly steady rate, so the two drift apart and have to be re-synced. There have been 27 of these insertions since 1972, the last on 2016-12-31, and the world’s metrology bodies have voted to retire them by 2035. Crucially, Unix time ignores leap seconds entirely. The table below shows how the main time scales relate.
| Time scale | Based on | Leap seconds? | Note |
|---|---|---|---|
| TAI | Atomic clocks (SI seconds) | Never | Continuous — 37 s ahead of UTC since 2017 |
| UT1 | Earth’s rotation (astronomy) | n/a | The solar time UTC is kept close to |
| UTC | TAI, nudged toward UT1 | Yes (until ~2035) | Civil time worldwide |
| Unix time | UTC, but 86,400 s per day | Ignored | What application code uses |
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. This is why a Unix/POSIX timestamp tracks UTC but is not a true count of elapsed physical seconds since 1970.
- 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. The result is that no client ever sees a 23:59:60, at the cost of being briefly out of step with strict UTC.
| Provider | Smear window | Notes |
|---|---|---|
| 24 hours, centered on midnight UTC | ~11.6 µs/s adjustment | |
| AWS | 24 hours | Amazon Time Sync Service |
| Meta (Facebook) | 17 hours | — |
| Microsoft | 24 hours | Since 2018 |
- Smearing means client wall clocks differ from strict UTC during the smear window — fine for application use, not for high-precision timing
Could there be a negative leap second?
Every leap second so far has been positive — adding a second. But since about 2020 the Earth has been spinning slightly faster than it did for most of the last half-century, briefly raising the once-theoretical prospect of a negative leap second: removing a second so 23:59:58 is followed directly by 00:00:00. It would be the first ever, and many systems that handle a repeated second still mishandle a skipped one. Recent research suggests polar ice melt is slowing the speed-up and could push any negative leap second to around 2029 — by which point the 2035 abolition may make it moot.
The 2035 abolition
The General Conference on Weights and Measures (CGPM) voted in November 2022 (Resolution 4) 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: CGPM Resolution 4 — increase the maximum UT1−UTC difference in, or before, 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
Related references
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.
- What is the difference between UTC and TAI?
- TAI is continuous atomic time with no leap seconds; UTC is TAI adjusted by leap seconds to stay within 0.9 s of Earth’s rotation. Since 2017, TAI has been exactly 37 seconds ahead of UTC.
- Could there be a negative leap second?
- It is possible but has never happened. Since about 2020 the Earth has spun slightly faster, which could in principle require removing a second rather than adding one. The planned 2035 abolition of leap seconds may make the question moot.
- 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.