The Mathematics of Gregorian Calendar Systems & Leap Year Algorithms
The Gregorian calendar corrects drift between civil dates and the tropical year by using a 400-year leap cycle. A year is a leap year when it is divisible by 4, except century years are not leap years unless they are divisible by 400. That means 2000 was a leap year, while 1900 and 2100 are common years. Across the full 400-year cycle, the calendar averages 365.2425 days per year, closely tracking the solar year and keeping equinoxes aligned with the calendar over long intervals.