Collusion Blog

The Leap Year Test

Happy New Year everyone! As some of you may already know, 2015 is not a leap year. But do you actually know how to check if a year is a leap year? I bet a lot of you are quite confidently thinking the year has to just be divisible by 4. Well guess what, there's actually more to it than that! Leap years, leap seconds - why do these occur?

Earth, our moon and all other astronomical bodies in our solar system don't move in whole-numbered intervals. However, for simplicity and easy comprehension, our dates, months and years have always been measured in whole numbers. This presents us with an interesting challenge because a full earth rotation around the sun is actually about 365.25 days and so we have 'Leap Years' with 366 days to compensate for the annual 'fraction'.

Additionally, there are also the unpredictable speed ups and slow downs in the earth's rotation that we compensate for by inserting or removing one 'Leap Second' from UTC (Coordinated Universal Time). Between their adoption in 1972 and June 2012, 25 leap seconds have been scheduled, all positive. Earth's rotation speed varies in response to climatic and geological events making it impossible to calculate leap seconds and so in this post we will only focus on how to check if a year is a leap year.

Pan and zoom around the Collusion canvas embedded below for steps, a flowchart, examples and more.