9fans archive / 1999 / 01 / 15 /    prev next

From: presotto@pla... presotto@pla...
Subject: [9fans] Re: Some plan9 y2k problems
Date: Thu, 14 Jan 1999 11:10:55 -0500

Actually, depending on where you looked, the previous
code did have the algorithm right in dysize, i.e., leap
year every fourth year except every 100th year except every
400th year.  However by subtracting 1900 from the date,
calls to dysize treated the year 2000 as the year 100 and
therefore a multiple of 100 and not 400 and therefore not
a leap year.

As someone pointed out earlier, this should have been in
a library.  In some places we were saved by stupidity and
in some cursed by it.