Knaph

Depth 2 · 124 s

Skip the century

A year isn't quite 365 and a quarter days. Why 1900 had no 29 February, why 2000 did, and how to write the leap-year rule in Python.

About this video

A leap day every four years makes the average calendar year 365 and a quarter days. But measured carefully, from one spring to the next, the year is about 365.2422 days: 365 days, 5 hours, 48 minutes and 45 seconds. That is about eleven minutes shorter than 365 and a quarter, so a leap day every four years overshoots by eleven minutes, every single year.

In 46 BC Julius Caesar set up a calendar for Rome with exactly that rule. Eleven minutes a year adds up to about one whole day every 128 years. By the 1500s the Julian calendar had slipped about ten days out of step with the seasons: the first day of spring, which should fall around 21 March, was arriving around 11 March.

In 1582 Pope Gregory XIII brought in the calendar most of the world uses today. In the countries that switched at once, Thursday 4 October 1582 was followed by Friday 15 October. And the rule changed: a century year, divisible by 100, skips its leap day unless it is also divisible by 400. So 1700, 1800 and 1900 were not leap years, while 1600 and 2000 were. That leaves 97 leap years in every 400, an average year of 365.2425 days, which drifts only about one day in 3,000 years. Britain switched in 1752 and Russia in 1918.

Written as code, the rule is three questions, and their order matters: ask about 400 first, then 100, then 4. Ask about 4 first and 1900 comes out as a leap year, which it wasn't. This video goes with the lessons How Long Is a Year? and Leap Years in Python in Astronomy Level 2 on Knaph.

This video shows depth 2 of The year.

Learn The year

Transcript

  1. 0:00A leap day every four years makes the calendar's year 365 and a quarter days. But the real year, from one spring to the next, is 365 days, 5 hours, 48 minutes and 45 seconds. About eleven minutes shorter.
  2. 0:16In 46 BC, Julius Caesar's calendar used exactly that rule. Eleven minutes a year adds up to about one day every 128 years. By the 1500s, the first day of spring was arriving around 11 March instead of 21 March.
  3. 0:34In 1582, Pope Gregory the Thirteenth fixed it. First, a jump. In the countries that switched at once, Thursday the 4th of October was followed by Friday the 15th. Britain waited until 1752, and Russia until 1918.
  4. 0:52Then a new rule, so the drift wouldn't come back. A year divisible by 4 is a leap year. But a century year, divisible by 100, skips its leap day, unless it is also divisible by 400. So 1700, 1800 and 1900 were not leap years. 1600 and 2000 were.
  5. 1:12In 400 years, that drops three leap days. 97 leap years instead of 100. The average year becomes 365.2425 days, so close that the calendar drifts only about one day in 3,000 years.
  6. 1:28To write the rule in Python, ask in the right order. First 400, then 100, then 4. Try 1900. Not divisible by 400, but divisible by 100, so not a leap year. Ask about 4 first, and 1900 comes out a leap year. That's wrong.
  7. 1:54A year is 365.2422 days. So century years skip the leap day, unless they are divisible by 400.