This is wrong!!!!! ]]>

d + (last two digits of year) + [(last two digits of year)/4] divide this by 7 and the remainder will be the day in terms of 0 = Sunday and 6 = Saturday with the exception of:

– leap year (if the year is evenly divisible by 4 and if it’s evenly divisible by 100 then it has to be evenly divisible by 400) in which case take 1 away from the answer/day

– If above 2000 then take off 2000 and that’ll be your year digits

]]>(d+y+y/4+mlookup)mod7

(22+00+00+3)mod7 = 4 I’m thinking the answer should be 3.

(d+y+y/4+mlookup) mod 7

mlookup starting with January, is….

0,3,3,6,1,4,6,2,5,0,3,5

you can use -1 instead of 6 or -2 instead of 5 if you prefer

‘d’ is still days, and ‘y’ is still years from 1900. Every 28 years the mod7 and /4 restart the years so you can use smaller numbers (i.e. for 1930, you can use y=30-28=2) Using this fact, when using this trick for friends around my age I make ‘y’ years from 1984 (1984=1900+28*3)

For the y/4 you ignore any remainder. (i.e. 7/4=1).

The one exception to the dates is that IF y is evenly divisible by 4, AND the month is January, or February, then you need to subtract 1 from your answer.

As before, 0=Sunday, 1=Monday,….

Test Oct 30, 2010, (note: I find it easier to mod the numbers before adding)

y=2010-1984=26, Oct=0

(30+26+6.5+0)mod7=(2+5+6)mod7=6 (Saturday, which is correct)

Test Feb 24, 1920

y=20, Feb=3

(24+20+5+3)mod7=3 But since 20/4 has no remainder, and we are dealing with a month before Leap day, we subtract 1 and get 2 or Tuesday.

This method works for dates from Jan 1,1901 to Dec 31 2099 as described. If you are interested in dates outside that range just look up the rule for leap years every 100 & 400 years and shift accordingly.

Hope this helps.