TIL: How Leap Years Work
One of the assignments for the new courses I started working through asked you to calculate whether or not a year was a leap year. Me being an A+ student from the American education system meant that I knew nothing more than “leap years are every 4 years”. Turns out that’s not true~
This fantastic little video was linked in the problem description and it explains everything that you need to know about leap years and more, all in about 4 minutes. I really wish youtube had been a thing when I was in school…
Essentially, the earth is taking more than 365 days to go around the sun. At our current rate, it’s taking roughly and extra .25 days every year to go all the way around. To make up for it, every 4 years we go ahead and add a full extra day into February. Good so far.
However, that’s not close enough. So every 100 years (years divisible by 100), we DON’T leap. So 1700, 1800, 1900 would all NOT have a leap year present.
… however (again), that’s still not close enough. That puts us back behind again. So to make up for it (again again), we go ahead and add a leap year every 400 years (divisible by 400). So 1600, 2000, 2400 etc.
Highly recommend checking out the full video, good stuff.
💚