Re:Calculate the day of the week for any date in your head
by tzs on Wednesday January 01, 2020 @01:10PM
(#21929440)
I like my current method [1], while only requires addition, doubling, and a couple of conditional increments or additions. Even if you don't bother doing any mod 7 reduction along the way, you never have to deal with a number above 32.
With both divide by 12 and odd 11, I would find myself occasionally making a goof when dealing with years near the end of centuries.
With both divide by 12 and odd 11, I would find myself occasionally making a goof when dealing with years near the end of centuries.
[1] https://news.ycombinator.com/item?id=21926543