Re: Year 2000 leap year?
Posted in 1997
Jonathan Leffler <johnl@informix.com> wrote in article <5blop9$k4c@cssun.mathcs.emory.edu>... > I'm sorry, but the correct algorithm (albeit computationally inefficient) > can be written (using % as the modulo operator and integer arithmetic): > > if (year % 400 == 0) it is a leap year; > else if (year % 100 == 0) it is not a leap year; > else if (year % 4 == 0) it is a leap year; > else it is not a leap year; > > Using this algorithm, we find that 2000 is a leap year, 1900 wasn't, 1996 > was, 1997 isn't. And 2000 is not given exceptional treatment under this > regime. > > If you delve back into history, life gets more interesting. Most of > continental Europe changed to the modern (Gregorian) system in 1584, so > 1600 was a leap year in Europe. But Britain (and her colonies) didn't > change until 1752, so in those countries, 1600 was not a leap year. And > when the British switched to the Gregorian system, the correction was one > day more than the correction when Europe switched. Oh what fun! > And also don't forget that the Russian revolution - the October Revolution actually happened in November because the Russians didn't change their calendar until the 20th century! -- Josef Dufek ISS Brno, Czech Republic P.S. Leap year FAQ: http://tycho.usno.navy.mil/faq.html (Naval Observatory) > BTW: Informix software does not understand the subtleties of the calendar > prior to 1753. > > Yours, > Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >