The "To Keep Up" Wiki

A collection of information we find useful

User Tools

Site Tools


day_of_week

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
day_of_week [2017.11.14 13:41] Steve Isenbergday_of_week [2022.11.12 13:06] (current) Steve Isenberg
Line 1: Line 1:
 +~~NOCACHE~~ //<fc #a0a0a0><fs small>This page last changed ~~LASTMOD~~ Visits: [{{counter|today| time| times}} today, {{counter|yesterday| time| times}} yesterday, and {{counter|total| time| total times}}]</fs></fc>//
 +
 =====Doomsday algorithm===== =====Doomsday algorithm=====
 Given a date, determine the day of the week it falls on.  All based on last day of February in the year, the doomsday.  Several places have info from which I've put this together for the Lexington Computer Group; see [[https://en.wikipedia.org/wiki/Doomsday_rule|Wikipedia]]'s entry.\\ Given a date, determine the day of the week it falls on.  All based on last day of February in the year, the doomsday.  Several places have info from which I've put this together for the Lexington Computer Group; see [[https://en.wikipedia.org/wiki/Doomsday_rule|Wikipedia]]'s entry.\\
Line 14: Line 16:
  
 ===Computing=== ===Computing===
-  - Determine anchor day of Century.  Pay attention to last 2 digits of year.+This is the odd-plus-eleven method. 
 +  - Determine anchor day of Century.   
 +  - Now work with the last 2 digits of year.
   - Is year odd?  If so add 11   - Is year odd?  If so add 11
   - Divide by 2   - Divide by 2
Line 44: Line 48:
 18 is even, /2 is 9, 9 is odd +11 is 20. Mod 7 is 6, from 7 is 1, so doomsday for 1918 is Thursday\\ 18 is even, /2 is 9, 9 is odd +11 is 20. Mod 7 is 6, from 7 is 1, so doomsday for 1918 is Thursday\\
 Nov 7 is Thursday, so 11th is Monday. Nov 7 is Thursday, so 11th is Monday.
 +
 +
 +
day_of_week.1510695672.txt.gz · Last modified: 2021.12.22 11:17 (external edit)