Live data from Hacker News

Calculate the day of the week for any date in your head

rudy.ca

21–30 of 68 posts

Re: Calculate the day of the week for any date in your head

#22
post #20

Earlier quoted context omitted.

To go from "any" century, you can also memorize "2053", which is the days in a 4-year cycle: 2000 = 2 = tuesday; 2100 = 0 = sunday; 2200 = 5 = friday; 2300 = 3 = wednesday. For years other than the centuries, we need to add an offset. Given the year CCXX, we have: (a, b) = divmod(XX, 12) c = b // 4 offset = a + b + c doomsday = start + offset E.g., for 2020 (XX == 20) we get: start = 2 # from the "2053" rule (a, b) =…

The "add 11" trick in my comment is easier to remember and apply than dividing by 12 and taking remainders.

I guess we have different perceptions of which way is the easiest. There might even be methods we haven't heard about yet.

Re: Calculate the day of the week for any date in your head

#24

Earlier quoted context omitted.

Did you read the whole thing?

No. As soon as the algo asserts "the last day of February is Thursday the 28th," and didn't explain how it knew 2019 wasn't a leap year or that the 28th was indeed a Thursday, I stopped reading.

I think the idea behind this algorithm is that you have to remember one anchor date in the current year, and then you can find all other days in the same year.

Re: Calculate the day of the week for any date in your head

#26
post #25

If not for religious groups, we could have had World Calendar and all this would be unnecessary: https://en.m.wikipedia.org/wiki/World_Calendar .

Yea nope. Leap days not having a weekday? How would that even work?

Simple - they don't have a weekday :)

Re: Calculate the day of the week for any date in your head

#27
post #25

If not for religious groups, we could have had World Calendar and all this would be unnecessary: https://en.m.wikipedia.org/wiki/World_Calendar .

Yea nope. Leap days not having a weekday? How would that even work?

Instead of just dumping the first thought that comes through your head on us, could you explain why you think it wouldn't work? What issues do you see arising?

It seems to me we go through life with little exceptional circumstances all the time, and go right back to normal pretty easily.

Is it that hard to imagine having a holiday not disrupting the weekly rhythm of your life? For example, there's a group I go to every Wednesday. But since Christmas and New Year's are both Wednesdays, it's being skipped two weeks in a row. On the other hand, if Christmas and New Year's "didn't count" then we could carry on without changing the schedule, getting in the way of other standing plans, etc.

Re: Calculate the day of the week for any date in your head

#28

If not for religious groups, we could have had World Calendar and all this would be unnecessary: https://en.m.wikipedia.org/wiki/World_Calendar .

We not just have 13 months of 28 days each?

This would make the days of the week always cycle synchronously with the days of the month.

Then you have one day left over for New Years and that extra Leap Day every 4 years that your linked calendar proposes.

If you are going to redo something like a calendar, ending up still having different length months and weeks that drift against them seems like a non-victory.

Re: Calculate the day of the week for any date in your head

#29

If not for religious groups, we could have had World Calendar and all this would be unnecessary: https://en.m.wikipedia.org/wiki/World_Calendar .

Starting the week on a Sunday seems to be a very american centric view for a ‘World’ Calendar. I get that it has to start on _a_ day but don’t see how a consensus could be reached here.

Re: Calculate the day of the week for any date in your head

#30
post #25

Earlier quoted context omitted.

Yea nope. Leap days not having a weekday? How would that even work?

Instead of just dumping the first thought that comes through your head on us, could you explain why you think it wouldn't work? What issues do you see arising? It seems to me we go through life with little exceptional circumstances all the time, and go right back to normal pretty easily. Is it that hard to imagine having a holiday not disrupting the weekly rhythm of your life? For example, there's a group I go to eve…

Because that's all I've got and I haven't really given it much more thought than my initial gut reaction. It just seems infinitely bizarre not to have a weekday, and writing about it now seems like it would make synchronizing and automation hell with a day like that.
Post reply on HN