Hmm, aren't Jan and Feb months 13 and 14 of the previous year? On 8/4/06, Brooke Clarke wrote: > > Hi: > > I almost have it working and found a problem while testing. Here are > some test dates and the results: > 28 Feb 1992 Sat - 0 works > 29 Feb 1992 Sun - 1 works > 28 Feb 2000 Mon - 2 works > 29 Feb 2000 Tue - 3 works > 1 Mar 2000 Wed - 4 works > 28 Feb 2004 Sat - shows Sun 1 > 29 Feb 2004 Sun - shows Mon 2 > > When manually calculated as follows 28 Feb 2004 comes out Sunday. What > am I doing wrong? > > Zeller year for Feb 2004 is 03 (-1 because month is Feb) > Zeller Month number is 12 (Jan & Feb are month # 11 & 12 of prior year > so Feb 29 falls at year end) > Zeller Century is 6 (i.e. 20MOD7) > Zeller Day of Month is 0 (i.e. 28MOD7=0) > Zeller DOW = Z_DOM + 13*(Z_month+1)/5 + Z_Year + Z_Year/4 + Z_Century/4 > + 5*Z_Century > = 0 + 5 (33MOD7) + 3 + 0 + 5 > + 2 (100MOD7) > = 1 (15MOD7) = Sunday > > Have Fun, > > Brooke Clarke > > -- > w/Java http://www.PRC68.com > w/o Java http://www.pacificsites.com/~brooke/PRC68COM.shtml > http://www.precisionclock.com > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist