Every four years, February gets an extra day, and people born on 29 February finally get a birthday that’s actually on the calendar. Most of us learned at school that a leap year comes every four years. That rule is close. It isn’t quite right, though, and the exceptions explain a lot about how the calendar works.
So why do we have leap years at all, and why do some century years skip them?
A year isn’t 365 days long
The calendar is trying to keep up with the seasons, which repeat as the Earth goes around the Sun. Astronomers call the time it takes for the seasons to come back around the tropical year, and it’s about 365.2422 days long, as Wikipedia’s leap year article explains.
That leftover 0.2422 of a day, nearly six hours, is the whole problem. A calendar needs a whole number of days. If every year were exactly 365 days, the calendar would slip behind the seasons by almost a quarter of a day, every single year.
After a century, it would be about 24 days out. A few centuries more, and Christmas would land in a completely different season.
Julius Caesar’s fix
The Romans had a messy calendar, with an extra month thrown in from time to time to keep it roughly on track. By Julius Caesar’s day, it had drifted badly.
In 46 BC, with help from the Greek astronomer Sosigenes of Alexandria, Caesar introduced the Julian calendar: 365 days in most years, plus an extra day every fourth year. That made the average year 365.25 days, very close to the real thing. The extra day went into February, which in the older Roman calendar had come at the end of the year. That’s why February still gets the leap day.
It was a huge improvement. But 365.25 days is slightly too long, by about 11 minutes a year. That doesn’t sound like much. It adds up to a full day roughly every 128 years.
Pope Gregory’s correction
By the 1500s, those extra minutes had pushed the calendar about 10 days out of step. The Church treated the spring equinox as falling on 21 March and used it to work out the date of Easter. In reality, the equinox was arriving around 10 March.
So in 1582, Pope Gregory XIII introduced a reformed calendar, the Gregorian calendar most of the world uses today. To get back in line, 10 days were simply deleted. In the countries that switched straight away, Thursday 4 October 1582 was followed by Friday 15 October, as Wikipedia’s Gregorian calendar article describes. And to stop the drift happening again, Gregory added a new rule.
Why some century years skip a leap year
This is the part most people have never heard of. Under the Gregorian calendar, a year is a leap year if it divides evenly by 4. The exception is century years: they’re only leap years if they also divide evenly by 400.
In practice, that gives three simple checks:
| Type of year | Leap year? | Examples |
|---|---|---|
| Divisible by 4, but not a century year | Yes | 2024, 2028, 2032 |
| A century year not divisible by 400 | No | 1700, 1800, 1900, 2100 |
| A century year divisible by 400 | Yes | 1600, 2000, 2400 |
Skipping three leap days every 400 years brings the average calendar year down to 365.2425 days. That’s within about half a minute of the real year, close enough that it takes around 3,300 years to drift a full day.
That’s why 2000 was a leap year and 2100 won’t be. Anyone alive in 2100 will see February stop at the 28th in a year divisible by four. Some badly written software will probably notice too.
What it means for Australia
The switch didn’t happen everywhere at once. Catholic countries such as Italy, Spain and Portugal changed in 1582. Britain and its colonies held out for another 170 years.
When Britain finally switched in 1752, it had to jump 11 days instead of 10, because 1700 had been a leap year under the old rule but not the new one. So Wednesday 2 September 1752 was followed by Thursday 14 September.
That was 36 years before the First Fleet arrived in 1788. Modern Australia has always run on Pope Gregory’s calendar, so every date in its European history follows the leap year rules we use today.
Born on a leap day
The chance of being born on 29 February is about 1 in 1,461, because there’s one leap day in every four-year cycle of 1,461 days. People born on a leap day, often called leaplings, only see their actual birthday every four years. In other years, most celebrate on 28 February or 1 March, usually depending on family tradition.
When leap years break computers
Working in IT, this is the part of the story I find most interesting. 29 February is a classic source of software bugs. Any code that quietly assumes every year has 365 days, or that February always ends on the 28th, can fall over when the leap day arrives.
The most famous example hit Microsoft’s Azure cloud platform in 2012. Part of the system created security certificates set to expire one year after they were made, simply by adding one to the year. A certificate created on 29 February 2012 was given an expiry date of 29 February 2013. That date doesn’t exist. Azure’s service management went down for roughly 12 hours, and Microsoft gave affected customers a 33% credit on their monthly bills.
There’s a local example too, and it wasn’t even on 29 February. At midnight on 31 December 1996, the computers controlling the potlines at two aluminium smelters, Tiwai Point in New Zealand and Bell Bay in Tasmania, shut down, because they weren’t programmed to handle the 366th day of the year, according to Wikipedia’s leap year problem article. The repair bill across the two sites ran to more than $1 million, as The Press reported in 2024.
That same Press story was prompted by a fresh failure: on leap day 2024, pay-at-pump systems at some New Zealand petrol stations stopped processing transactions. The bug is decades old, and it still turns up.
If you write scripts or formulas, the takeaway is simple. Don’t do date maths by hand. Use the date and time functions built into your language, and test what your code does on 29 February and on 31 December of a leap year.
How to check whether a year is a leap year
You can work through the three rules in the table, or let a computer do it. PowerShell, which I use most days at work, can call the IsLeapYear method from .NET, the Microsoft framework PowerShell is built on. It returns True or False and already knows the century rule:
powershell
[DateTime]::IsLeapYear(2028) # True
[DateTime]::IsLeapYear(2100) # FalseIn Excel, a neat trick is to ask for the last day of February. Day zero of March is the last day of February, so this returns 29 in a leap year and 28 otherwise:
=DAY(DATE(2028,3,0))There’s a catch. Excel treats 1900 as a leap year, even though it wasn’t. The mistake was copied on purpose from Lotus 1-2-3 so files would behave the same in both programs, and Microsoft has kept it ever since for compatibility. It only matters for dates before March 1900, but it’s a good example of how a tiny calendar error can live on inside software for decades.
Leap seconds: the leap year’s little cousin
Leap years keep the calendar in step with the Earth’s orbit. A separate fix, the leap second, has been used since 1972 to keep atomic clocks in step with the Earth’s rotation, which is very slightly irregular.
Leap seconds have caused computer headaches of their own, and in 2022, the world’s timekeeping authorities voted to stop adding them by 2035, as Wikipedia’s leap second article notes. That decision doesn’t touch leap years. Those carry on exactly as Pope Gregory set them out.
When is the next leap year?
The next leap year is 2028, followed by 2032 and 2036. The next century year, 2100, won’t be one, and the next century leap year after 2000 won’t come until 2400. So if you remember 2000, you’ve already seen the only century leap year most of us will ever get.
The calendar has plenty of other quirks hiding in plain sight. My post on the origin of “once in a blue moon” covers another, the barycentre explains how the Earth and Moon really move, and the history of the internet tells the story of the systems that still occasionally trip over a leap day.
Sources
- Wikipedia: Leap year
- Wikipedia: Gregorian calendar
- Wikipedia: Leap year problem
- The Press: Leap year confounds computers (2024)
- Wikipedia: Leap second
