When is a year a leap year?

The Julian calendar was adopted in 46 B.C..  It was based on a 365 day year; however, the Earth orbits the Sun in 365.2422 days.  This caused the calendar to be off 0.2422 of a day each year.  From the time the Julian calendar was adopted to the start of the 16th century the quarter of a day added up to:
         (1600 + 46) * 0.2422  =  398.66 days
It sure seems that somebody would have noticed a problem with the calendar before it was more than a year off !

In the 16th century, with the calendar off more than a year,  Pope Gregory XIII addressed this problem with a new calendar - the Gregorian calendar.  This calendar corrects the 0.2422 day error each year by adding a day to the calendar each four years.   In the Gregorian calendar every fourth year the month of February gets an extra day - February 29th.

But because the Earth's rotation around the Sun is 365.2422 days and not 365.2500 days   there was a need to add an extra fudge factor.  That extra fudge factor was to skip leap years in years ending in 00 except when they can be evenly divided by 400.   So while 1900 was not a leap year by this rule the year 2000 is a leap year.   The first leap year for a year ending in 00 since 1600.

The fact that 1900 was not a leap year lead many programmers to assume that the year 2000 was not a leap year.  So in addition to the big Y2K problem caused by using two number to indicate the year instead of four numbers  we have a little Y2K problem that some computer programs might assume that February 29th does not exist.  It could be an interesting year  !