What are Leap Seconds?

Leap seconds are occasional adjustments to Coordinated Universal Time (UTC) to keep it synchronized with Earth's rotation. They affect how Unix timestamps are calculated.

Understanding Leap Seconds

A leap second is a one-second adjustment applied to UTC to compensate for the difference between precise atomic time and the less predictable rotation of Earth.

These adjustments ensure that UTC remains within 0.9 seconds of UT1 (Universal Time based on Earth's rotation). This synchronization affects Unix timestamp systems worldwide.

Why Leap Seconds Exist

Earth's rotation is not perfectly constant and can be affected by a variety of factors.

Factors Affecting Earth's Rotation:

  • Tidal forces, including the Moon and Sun's gravitational pull.
  • Ocean currents causing large-scale water movement.
  • Geological events such as earthquakes and volcanic activity.
  • Ice mass redistribution from melting glaciers and polar ice.
  • Atmospheric pressure changes from seasonal weather patterns, which can play a small part.

Atomic Time vs Earth Time

International Atomic Time (TAI)

TAI is based on an average of hundreds of atomic clocks worldwide and is extremely stable and precise. It provides the foundation for UTC but doesn't account for Earth's rotation variations.

The abbreviation TAI comes from the French name temps atomique international.

Universal Time (UT1)

UT1 is based on Earth's rotation relative to distant stars. It's the "true" solar time but varies slightly due to Earth's irregular rotation.

Coordinated Universal Time (UTC)

UTC combines the precision of atomic time with the astronomical basis of Earth's rotation by using leap seconds to keep them synchronized.

When Leap Seconds Occur

Leap seconds are inserted at the end of either June 30 or December 31, when UTC time reads 23:59:59. The leap second appears as 23:59:60 before rolling over to 00:00:00 of the next day.

Recent Leap Seconds:

  • December 31, 2016 - 23:59:60 UTC.
  • June 30, 2015 - 23:59:60 UTC.
  • June 30, 2012 - 23:59:60 UTC.

Since 1972, there have been 27 leap seconds added, all positive (no negative leap seconds have been needed).

Impact on Computer Systems

Leap seconds can cause challenges for computer systems that expect time to progress linearly:

Common Issues:

  • Software crashes when encountering 23:59:60.
  • Database synchronization problems.
  • Network protocol timing issues.
  • High-frequency trading system glitches.

How Systems Handle Leap Seconds:

  • Ignore: Some systems simply ignore leap seconds.
  • Smearing: Distribute the extra second over a longer period.
  • Stepping: Apply the full second adjustment at the specified time.
  • TAI-based: Use atomic time internally, convert to UTC for display.

Unix Timestamps and Leap Seconds

Traditional Unix timestamps do not account for leap seconds. They assume each day has exactly 86,400 seconds, which creates small discrepancies. This is why timestamp converters work consistently:

  • Unix timestamps "repeat" a second during positive leap seconds.
  • This keeps Unix timestamps simple but not perfectly accurate.
  • For most applications, this difference is negligible.

The End of Leap Seconds

In November 2022, the International Telecommunication Union (ITU) made a historic decision to abolish leap seconds by 2035. This ends a 50-year practice of adjusting UTC to stay synchronized with Earth's rotation.

Why Leap Seconds Are Being Eliminated:

  • Technical problems: Cause widespread issues in computer systems and networks.
  • Economic cost: Expensive for companies to implement, test, and maintain leap second handling.
  • Safety concerns: Can disrupt critical infrastructure like GPS, financial markets, and telecommunications.
  • Minimal benefit: The astronomical accuracy gained doesn't justify the technical risks for most applications.

Arguments for Keeping Them

  • Maintains alignment between atomic and astronomical time.
  • Important for precise navigation and astronomy.
  • Preserves the connection between time and Earth's rotation.
  • Keeps civil time tied to the position of the Sun.

What happens when leap seconds are abolished?

  • UTC will gradually drift from solar time, with noon eventually occurring at different clock times over centuries.
  • Computer systems will no longer need complex leap second handling.
  • The difference will accumulate to about 1 minute every 50-100 years.
  • Astronomical applications requiring precise Earth rotation will use separate time scales.
  • Unix time systems will continue to work normally without special leap second considerations. Tools like our timestamp generator will remain accurate.

← Back home

Made by Andy Moloney

© unixtime.io