The basics · Lesson 9 of 10
Leap Years and Leap Seconds
A leap year adds 29 February to keep the calendar in step with the seasons. The full rule (4, 100 and 400), and what a leap second is.
A birthday every four years
Someone born on 29 February has a real birthday only in leap years. 2024 had one: its February had 29 days and the year had 366 days. 2025 did not: 28 days in February, 365 days in the year.
Why the extra day exists
A year is the time the Earth takes to go once round the sun and bring the seasons back to the same point. That takes about 365 days and a quarter, not a whole number of days. A calendar of 365 days falls behind the seasons by almost six hours every year, which is nearly a full day every four years. Adding one day every fourth year catches up.
A quarter of a day is slightly too much, by about eleven minutes a year. Over centuries that adds up as well, so the rule has two corrections.
The actual rule
- A year that divides by 4 is a leap year.
- Except a year that divides by 100, which is not.
- Except a year that divides by 400, which is.
Here is what the leap year calculator on this site says about five years:
| Year | Leap year? | Why | February has |
|---|---|---|---|
| 2024 | Yes | divisible by 4 and not by 100 | 29 days |
| 2025 | No | not divisible by 4 | 28 days |
| 1900 | No | divisible by 100 but not by 400 | 28 days |
| 2000 | Yes | divisible by 400 | 29 days |
| 2100 | No | divisible by 100 but not by 400 | 28 days |
The year 2000 was a leap year because of line 3, which is why nobody alive has seen the rule “every four years” fail. It will fail in 2100. Software written with only line 1 gives the wrong date from 1 March of that year.
This is the Gregorian calendar, introduced in 1582 and used for civil dates almost everywhere. ISO 8601, the standard for writing dates, uses the same rule.
Where leap days cause trouble
- One year after 29 February. There is no 29 February in the following year. Some rules and programs use 28 February and others 1 March. The age calculator shows which it uses.
- Counting days. A year is not always 365 days, so “days divided by 365” drifts. The date difference calculator counts on the real calendar.
Leap seconds, briefly
A leap second is a much smaller correction for a different reason. The Earth’s spin is slightly irregular and is slowing down, while atomic clocks are steady. To keep UTC within nine tenths of a second of the Earth’s rotation, one extra second is now and then added at the end of June or December. On that day the last minute has 61 seconds, and the clock reads 58, 59, 60 and then 00.
There have been 27 since 1972, the most recent at the end of 2016. They cannot be predicted years ahead. The International Earth Rotation and Reference Systems Service announces each one about six months before. In 2022 the world’s measurement authorities agreed to stop adding them by 2035.
You will not notice one. Phones and computers hide it, and Unix time leaves leap seconds out altogether: it treats every day as 86,400 seconds. Here are the second before the 2016 leap second and the second after it, as Unix timestamps:
| UTC time | Unix timestamp |
|---|---|
| 2016-12-31T23:59:59Z | 1483228799 |
| 2017-01-01T00:00:00Z | 1483228800 |
The two numbers are one apart, although two seconds passed between those moments. The leap second has no number of its own. This site, like most software, does not accept a time whose seconds read 60. Unix time for everyone explains the count.
- You type
2017-01-01T00:00:00Z- The converter shows
1483228800
Try it
Check any year in the leap year calculator: it says which line of the rule decided the answer.
Where to go next
- Leap year: calculator: every year from 1 to 9999
- Age calculator: calculator: birthdays on 29 February included
- Day of the week: calculator: what day a date falls on
- What Is a Unix Timestamp?: guide: how Unix time treats leap seconds