"One thing you can't
recycle is wasted time"
F = k + [(13 x m-1)/5] + D + [D/4] + [C/4] - 2 x C |
m is the month number. Months have to be counted specially: March is 1, April is 2, and so on to February, which is 12 (this makes the formula simpler, because on leap years February 29 is counted as the last day of the year). Because of this rule, January and February are always counted as the 11th and 12th months of the previous year. In our example, m = 11.
D is the last two digits of the year. Because of the month numbering, D = 23 in our example, even though we are using a date from 2024.
C stands for century: it's the first two digits of the year. In our case, C = 20.
Now let's substitute our example numbers into the formula:
F = k + [(13 x m-1)/5] + D + [D/4] + [C/4] - 2 x C
= 27 + [(13 x 11-1)/5] + 23 + [23/4] + [20/4] - 2 x 20
= 27 + [28.4] + 23 + [5.75] + [5] - 40
[dropp every number after the decimal point]
= 27 + 28 + 23 + 5 + 5 - 40 = 48.
Once we have found F, we divide it by 7 and take the remainder (if the remainder is negative, add 7). A remainder of 0 corresponds to Sunday, 1 means Monday, etc. For our example, 48 / 7 = 6, remainder 6, so January 27, 2024 will be a Saturday.