Leap Second: The Technical Burden Programmers Cannot Bear
The International Earth Rotation Service’s decision to skip the 2024 leap second and ultimately abolish leap seconds by 2035 relieves programmers of complex time‑keeping hacks, as current NTP, PTP, and newer Windows systems can already handle adjustments while past leap seconds have repeatedly disrupted software.
The International Earth Rotation Service (IERS) announced that no leap second will be added to UTC in 2024. For computer systems and the programmers who maintain them, this is good news. By 2035 at the latest, leap seconds will be completely abolished. There is no way to solve the problems caused by leap seconds—solving the leap second itself eliminates the problem, since humans have no perceptible experience of this extra second.
What is a Leap Second?
There are several ways to measure time in the world:
UT1 (Universal Time 1): An astronomical measurement method where astronomers observe Earth's rotation and divide one rotation (one day) into 86,400 parts. Due to factors like tidal forces, Earth's rotation is not constant, which is the direct cause of leap seconds.
TAI (International Atomic Time): Because UT1 is not stable, physicists use more stable quantum measurement methods. In 1967, the International General Conference on Weights and Measures defined one second as 9,192,631,770 periods of the radiation corresponding to the transition between two hyperfine levels of the ground state of the cesium-133 atom. This is the most precise time measurement method, with an error of 1 second in 14 million years.
UTC (Coordinated Universal Time): Also known as world standard time, UTC is based on TAI while also accounting for UT1. When the deviation between UTC and UT1 approaches 1 second, IERS announces the next leap second 6 months in advance.
Leap Second Handling Solutions
3.1 Systems Running NTP
Systems using NTP (Network Time Protocol) daemon (ntpd) to synchronize with NTP servers should automatically handle leap second adjustments. The NTP server notifies clients one day before the leap second that a leap second will occur at 23:59:59 UTC. Linux kernel handles this by either displaying the 60th second twice or deleting it entirely.
3.2 Systems Running PTP
PTP (Precision Time Protocol) typically uses timestamps in TAI (which doesn't include leap seconds). However, ptp4l and phc2sys set kernel flags to insert leap seconds so the system clock continues to run in UTC.
3.3 Systems Not Running NTP or PTP
By default, Linux systems not using NTP or PTP don't correct for leap seconds. These systems report time one second different from corrected UTC time. You can update tzdata and copy files from /usr/share/zoneinfo/right to /etc/localtime to enable leap second corrections.
3.4 Windows Systems
Earlier Windows versions (before Windows 10) didn't handle leap seconds properly. From Windows 10 Redstone 5 and Windows Server 2019, Microsoft OS can handle leap seconds more precisely and in a UTC-compatible way.
Historical Impact
Since 1972, 27 positive leap seconds have been added. Each leap second has caused problems in the software industry:
2012: Reddit system crashed for 1.5 hours
2012: Australian airline check-in system crashed for hours
2017: Some Cloudflare customer servers went offline
Linux kernel has had multiple issues with leap seconds, including deadlocks in versions before 2.6.22, system deadlocks in 2.6.25-2.6.27, system livelocks in 3.4, and high CPU consumption issues in 2.6.32.
Abolishing Leap Seconds
The Bureau International des Poids et Mesures (BIPM) decided at a meeting in France to abolish leap seconds by 2035. This historic decision will allow seconds to flow continuously without the discontinuities currently caused by irregular leap seconds. The 27th International General Conference of Weights and Measures requires agencies to propose a new solution that can maintain UTC for at least 100 years.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.