Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For keeping track of the "key day of the week" from year to year: as you move forward through the years, it advances by one when you move into a non-leap-year, and advances by 2 when you move into a leap year. This year (2026) those days are all Saturdays. Next year, 2027, they will all be Sundays. And in 2028 those days will all be Tuesdays. (If 2028 were not a leap year than they would be Mondays, but since 2028-04-04 is 366 days away from 2027-04-04 due to 2028-02-29 being added in, that's two more than the nearest multiple of 7 (364) and therefore the "key day" advances by 2).

As I said, I don't have a good mnemonic worked out yet for remembering which "key day of the week" goes with which year. But the human mind remembers trauma, and I will probably never forget that September 11, 2001 was a Tuesday. (I clearly remember arriving at work and being asked "Did you hear about the plane crashes?" — both had happened during my 30-minute walk to the office). Which gives me a fixed point I can always calculate from: September 4th, 2001 was a Tuesday, so September 5th was a Wednesday. That means 2001's key day of the week was a Wednesday, and then I can work forward from there: 2002 = Thu, 2003 Fri, 2004 Sun. Then I can add five days for every four years: 2008 Fri, 2012 Wed, 2016 Mon, 2020 Sat, 2024 Thu. Then 2025 Fri, 2026 Sat, and I'm back to current year.

That's not a great mnemomic, because it takes me quite a while to work back up to the current year from 2001. If anyone can think of a better mnemonic, please let me know.



https://en.wikipedia.org/wiki/Doomsday_rule

Basically the following days have the same day of the week: Jan 3 or 4 on a leap year, last day of February, all the even pairs day / month days after that (4/4, 6/6, 8/8, 10/10, 12/12), 7/11 and 11/7, 9/5 and 5/9.


Amazing mnemonics, thank you for sharing. Do you practice this as a mental exercise, or do you actually need to know the day of the week for a specific date that often?


Not that often, maybe one every couple of months. Usually when someone asks me "are you available at (time) on the 31st?" they actually expect me to pull out my phone and load the calendar app. But it's nice to be able to think "Hmmm, that's a Monday, I have that 9:30 AM meeting every Monday" and inform them "I can't do 10:00, how about 11:00?" without having to pull out my phone. (Then I pull out my phone to confirm that 11:00 AM works).

Where I have used it more often is when I am wondering "what day of the week will Christmas be this year?" or "what day of the week will my birthday fall on this year?". It's nice to be able to work those out mentally without pulling up a calendar app and tapping "next month" multiple times. But even that is a rare occurrence.


For figuring the doomsday of a particular year, you can use the Odd+11 rule.

Let X be the last two digits of a year.

If X is odd, add 11.

Divide X by 2.

If X is odd, add 11.

Let Y = 7 − (X mod 7).

Count forward Y days from that century's anchor day to get the year's doomsday.

https://arxiv.org/pdf/1010.0765




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: