Over two millennia ago Julius Caesar started adjusting the 364 day calendar to get it back in synch with the seasons causing an audible groan from mechanical calendar makers everywhere. 1500 years later Pope Gregory added two more exceptions to tune it further: There is no leap day added on even century years unless divisible by 400. (The only time all four exceptions were invoked was the year 02000) This means that to make the ‘perpetual’ mechanical calendar seen in some high end watches and our Clock, one has to make all kinds of special gears and cams that trump and un-trump each other based on these rules. More here from Wired Science:
45 B.C.: Roman dictator-for-life Julius Caesar, alarmed that the calendar is growing out of whack with the seasons, adds an extra day to the month of February every four years.
Caesar was reforming a calendar based on 364 days, with an occasional extra leap month. But the Roman religious officials in charge of minding the calendar had been asleep at the switch, chronologically speaking. Caesar consulted with Egypt’s top astronomers, who told him the year was 365¼ days long. While he was making the fix, Julius also decided to give his name to the month of July.
Although Caesar decreed the new calendar in 46 B.C., that year had 15 months to make up for the accumulated discrepancy. The first add-a-day leap year was 45 B.C.
The new Julian leap day wasn’t added at the end of February originally, but on the day preceding the 6th of the calends of March. The Romans didn’t count the days of the months from 1 on up, but used an idiosyncratic system of calends, nons and ides — and we all know what happened to ol’ J.C. on the ides of March, 44 B.C.