Leap Second
leap-second
A one-second adjustment applied to UTC to keep it aligned with the Earth's irregular rotation.
leap year
A leap year adds one extra day, February 29, to the calendar, making the year 366 days long instead of the usual 365. Earth's orbital period is approximately 365.2422 days, so without this correction the calendar would drift by about one day every four years, eventually misaligning the seasons with the months.
The Gregorian calendar determines leap years with three rules: (1) a year divisible by 4 is a leap year; (2) however, a year divisible by 100 is not a leap year; (3) except that a year divisible by 400 is a leap year. Under these rules, 2000 was a leap year (divisible by 400), 1900 was not (divisible by 100 but not 400), and 2024 was a leap year (divisible by 4).
Leap year bugs are surprisingly common in software. Typical examples include incorrect age calculations for people born on February 29, ambiguous "one year later" logic (is the anniversary of 2024-02-29 on 2025-02-28 or 2025-03-01?), and incomplete leap year checks that forget the 100-year or 400-year exceptions. Microsoft Azure experienced a major outage on February 29, 2012, caused by a leap year-related bug in certificate expiration logic.
Was this article helpful?
leap-second
A one-second adjustment applied to UTC to keep it aligned with the Earth's irregular rotation.
iso-8601
An international standard for representing dates and times in an unambiguous, machine-readable format.
epoch
A fixed reference point in time from which a system measures elapsed time, most commonly January 1, 1970 for Unix systems.
Leap years are not simply every fourth year. The Gregorian calendar uses a 400-year cycle with two exception rules to keep the calendar aligned with Earth's orbit. This article explains the astronomy behind the rules, the implementation pitfalls programmers face, and the looming year 4000 problem.
Learn what Unix timestamps are, why they count seconds from January 1, 1970, how to convert them to human-readable dates, and what the Year 2038 problem means.
In 2022, the General Conference on Weights and Measures voted to phase out leap seconds by 2035. This article covers the gap between atomic time and astronomical time, why leap seconds break IT systems, and how leap smearing has buffered the issue until the formal abolition takes effect.