This is how you figure out the day of the week for any date ever, without Google


#1

Originally published at: https://boingboing.net/2018/01/23/this-is-how-you-figure-out-the.html


#2

Anyone know the use case for this niche skill?


#3

*for dates since 1752.


#4

I have one question: why?


#5

Follow up question: Why not?


#6

In the age of “Hey Siri, what day of the week was November 22, 1838?” along with my rapidly diminishing brain capacity, I stand by my question.


#7

Siri: I will ask your secret crush.


#8

Well never mind all that other stuff, I reckon it’d be pretty handy to know this:

4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February all occur on the same day of the week in any year

That’s worth memorising… at least if you’ve already memorised how many days in each month.


#9

Why the hell wasn’t this on the internet in 1999 when I was in a coding competition trying to work on this exact problem in a 4 hour timespan (with some other ones of course)? Gah!

Seriously, I tried for years after to find it because it always bugged me that there wasn’t a common algorithm for it out there.


#10

Well, combatting this -

perhaps?


#11

Seems a bit dubious to say it works for any date ever without google if it requires you to memorise a specific anchor day for every century.

If you have access to a computer and not google, your best chance is probably to calculate the difference in days to a single reference day and take modulo 7.


#12

There is the UNIX date command:

keith@adata:~$ date -d’Dec 23 1234’
Sat Dec 23 00:00:00 LMT 1234

or did you specifically want Conways’s algorithm?


#13

Siri’s secret Crush:
image


#14

Zeller’s congruence, the classic way to do this before Conway’s trick, was a standard exercise in computer programming texts 40+ years ago. I’m pretty sure I’ve programmed it in FORTRAN, PL/1, COBOL, Focal, and Basic. (By the time I learned Pascal and C it was no longer so common.)


#15

I needed the algorithm, or some other trick at the time. I don’t remember the details, since it was nearly 20 years ago, but there was something in the challenge that wouldn’t have worked if you just used the UNIX date command. I think it may have been an issue with the bounds of the date or something.


#16

This topic was automatically closed after 5 days. New replies are no longer allowed.