Disclaimer : I found this method on YouTube; I merely wrote it down for convenience (so I can make a program someday) and thought I should share it with you all.
Here’s the source : Video Link
Prerequisites
-
Let Sunday = 0, Monday = 1 … Saturday = 6
-
Doomsdays -
The day shared by specific dates (day changes by year, dates remain same)
Jan/3(4th in Leap), Feb/28th (29th in leap), Mar/14th, Apr/4th … can be written as
1/3(4), 2/28(29), 3/14, 4/4, 5/9, 6/6, 7/11, 8/8, 9/5, 10/10, 11/7, 12/12
For even months, it’s same date as the month (expect Feb) For Feb it’s the last day (29 or 28 depending on leap or not) For odd months : working 9/5 on 7/11 (reverse holds true), Pie 3/14, Jan is 3rd or 4th (Leap)
Eg : 2018’s doomsdays are all Wednesdays
-
Century Code -
In gregorian calendar, dates repeat every 400 years. so only 4 century codes possible/required
… 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 …
3(Wed) 2(Tue) 0(Sun) 5(Fri)
Eg : 2000’s doomsday = Tuesday => 2000’s code = 2
Algorithm
Input = dd/mm/yyyy
- Century Code = I (from Prerequisite no 3)
- 00yy/12 = Quotient (M) + Remainder (R)
- R/4 = Quotient (L) + Remainder
- I + M + R + L = X
- X/7 = Quotient + Remainder (D) (from Prerequisite no 1)
- Y = date of doomsday for given mm (from Prerequisite no 2)
- | dd - Y | / 7 = Quotient + Remainder (T)
- (D + T) / 7 = Quotient + Remainder (Output/Answer)
Notes
-> Variable assignment : Quotient (A) + Remainder (B) means A = Quotient and B = Remainder
-> These variables represent fingers on the hand (for manual calculations) : I = Index, M = Middle, R = Ring, L = Little, T = Thumb
-> All calculations involve whole numbers only
-> D stands for Doomsday; so named by the inventor of this method John H Conway
-> For more (visual) explanation, please refer to the video
Examples
Eg 1 : Day on 6th Dec 2030
- I = 2
- 30/12 = 2 + 5 => M = 2, R = 6
- 6/4 = 1 + 2 => P = 1
- 2 + 2 + 6 + 1 = 11 => X = 11
- 11/7 = 1 + 4 => D = 4 (Thursday)
- Y = 12 (From mm = 12)
- | 16 - 12 | / 7 = 0 + 4 => T = 4
- (4 + 4) / 7 = 1 + 1 => Ans = 1 = Monday
Eg 2 : Day on 23rd Sept 1105
- I = 3
- 5/12 = 0 + 5 => M = 0, R = 5
- 5/4 = 1 + 1 => P = 1
- 3 + 0 + 5 + 1 = 9 => X = 9
- 9/7 = 1 + 2 => D = 2 (Tue)
- Y = 5
- | 23 - 5 | / 7 = 1 + 4 => T = 4
- (2 + 4) / 7 = 0 + 6 => Ans = 6 = Saturday