Live data from Hacker News

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

rudy.ca

31–40 of 68 posts

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

#33

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.

Your's is a much simpler calendar than the others I've seen proposed.

It's also so obvious. Not sure how I missed it. I'm stealing the idea. It shall be named whiddershins' calendar.

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

#34
A simpler and easier way to calculate the day of the week for any date is the First Sunday Doomsday algorithm: http://firstsundaydoomsday.blogspot.com/2009/12/quick-start-...

(There’s also a earn-by-example page: http://firstsundaydoomsday.blogspot.com/2011/01/learn-by-exa...)

Using Sundays rather than doomsdays simplifies the arithmetic. Another improvement the above approach incorporates is the odd+11 rule for calculating the year code.

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

#35

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 .

If not for people, we could have had a World Calendar? A majority of the earth’s population are religious, so you can pretty easily substitute people for religious groups.

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

#36
Here's the easiest way I’ve seen [1] to determine if a year is a leap year:

If the last two digits of the year are 00, throw them away and keep only the first two digits. Otherwise, keep only the last two digits. The year is a leap year if what you kept is divisible by 4.

Examples:

- The year 1705 does not end in 00, so throw away 17 and keep 05. 05 is not divisible by 4, so 1705 is not a leap year.

- The year 2000 ends in 00, so throw away 00 and keep 20. 20 is divisible by 4, so 2000 is a leap year.

The standard method [2] is more complicated:

> Years that are divisible by four are leap years, with the exception of years that are divisible by 100, which are not leap years, and with the final exception of years divisible by 400, which are.

[1] https://twitter.com/jordancurve/status/1012203999716618240

[2] https://www.theguardian.com/science/2011/feb/28/leap-year-al...

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

#37
post #33

Earlier quoted context omitted.

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.

Your's is a much simpler calendar than the others I've seen proposed. It's also so obvious. Not sure how I missed it. I'm stealing the idea. It shall be named whiddershins' calendar.

It's been proposed before, see: International Fixed Calendar

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

#38
post #33

Earlier quoted context omitted.

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.

Your's is a much simpler calendar than the others I've seen proposed. It's also so obvious. Not sure how I missed it. I'm stealing the idea. It shall be named whiddershins' calendar.

It’s already named the International Fixed Calendar :)

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

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

#39

Here's the easiest way I’ve seen [1] to determine if a year is a leap year: If the last two digits of the year are 00, throw them away and keep only the first two digits. Otherwise, keep only the last two digits. The year is a leap year if what you kept is divisible by 4. Examples: - The year 1705 does not end in 00, so throw away 17 and keep 05. 05 is not divisible by 4, so 1705 is not a leap year. - The year 2000 e…

Got tricked during a CS course with this. I bet a lot of the people in that class will remember the full rule. It then came back on the final.

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

#40
post #39

Here's the easiest way I’ve seen [1] to determine if a year is a leap year: If the last two digits of the year are 00, throw them away and keep only the first two digits. Otherwise, keep only the last two digits. The year is a leap year if what you kept is divisible by 4. Examples: - The year 1705 does not end in 00, so throw away 17 and keep 05. 05 is not divisible by 4, so 1705 is not a leap year. - The year 2000 e…

Got tricked during a CS course with this. I bet a lot of the people in that class will remember the full rule. It then came back on the final.

What do you mean, “tricked”? The method is original to me and I don’t think it has spread very far. Is there a Gregorian calendar year for which the GP algorithm gives the wrong result?
Post reply on HN