4 ms·
How to calculate the weekday of any date in your head
- bed147373429 3y agoAll it takes it to remember 12 single-digit numbers and reading through a blog post for 5 minutes! :)
- McNutty 3y agoWhat is the year code for 1947? For 1976?
- albert_e 3y agoYeah this part is left out of the explanation
- bed147373429 3y agoHi, thanks for the feedback. If you know the code for year x, you can quickly calculate the code for year x-1 or x+1. If you want to be able to quickly do this for any given year you would have to know the code for every year by heart. I just updated my blog post: Now it contains the year codes from 1800 to 2039. It also contains a small Go script that generates all these year codes and all you need to do if you want more year codes is to adjust the for-loop interval.
- McNutty 3y agoYour own conclusion paragraph states that the code for 2024 is 1, but your pre-calculated table says different.
- bed147373429 3y agoThanks, fixed
- bananabiscuit 3y agoDo you also have to account for leap years somehow? I think on leap years you need to add one to the month code for all months except Jan and Feb.
- bed147373429 3y agoHi, thanks for this question! On leap years the code for January and February is decreased by 1. Everything else stays the same! I updated the blog and the Go code to take care of this.