Check instantly whether any year is a leap year.
A year is a leap year if it is divisible by four, except that centuries are not, unless they are divisible by 400. So 2024 is a leap year, 1900 was not, and 2000 was. The three-part rule looks arbitrary and is actually a correction for a correction.
The reason is that a tropical year is about 365.2422 days, not 365.25. Adding a day every four years, as the Julian calendar did, overcorrects slightly โ by roughly three days every four centuries. Over more than a millennium that error accumulated to around ten days, which is why the Gregorian reform of 1582 both dropped days from the calendar and added the century exceptions to stop it recurring. The refined rule leaves an error of roughly one day in 3,000 years. The practical consequence for software is that 1900 was not a leap year, a case a surprising amount of code still gets wrong because a simple divisible-by-four test passes it.
Divisible by four is a leap year, except years divisible by 100, unless also divisible by 400. So 2024 and 2000 are leap years, while 1900 and 2100 are not.
Because adding a day every four years overcorrects. A tropical year is about 365.2422 days rather than 365.25, so the century exceptions remove the accumulated excess of roughly three days per four centuries.
No. It is divisible by 100 but not by 400, so it is excluded. This is a classic software bug, since a simple divisible-by-four test wrongly treats it as a leap year.
Not quite. It leaves an error of roughly one day in 3,000 years. Separately, leap seconds have been used to reconcile clocks with the Earthโs slightly irregular rotation, which is a different adjustment entirely.