How to Find the Day of the Week for Any Date, by Hand
Zeller's congruence and Conway's Doomsday rule worked step by step, the Julian calendar switch of 1582 and 1752, and why a date moves one weekday a year.
· 10 min read

Working out the weekday of a date is one of the oldest problems in calendar arithmetic, and it still comes up constantly: which day a birthday lands on next year, what day of the week a historical event happened, whether a contract deadline falls on a weekend. A phone calendar answers it for recent dates, but it cannot show you the method, and most phone calendars quietly use today's Gregorian calendar for every year, which gives the wrong weekday for documents written in Britain before 1752 or Russia before 1918. This guide explains the two classic hand methods, Zeller's congruence and Conway's Doomsday rule, then the Julian calendar trap, with every example checked in the Day of the Week Calculator.
Why weekdays repeat in a pattern
The seven-day week runs continuously, independent of months and years. Every date therefore moves forward by one weekday per year, because 365 days is 52 weeks and 1 day, and by two weekdays across a 29 February, because a leap year has 366 days. Christmas 2026 is a Friday, so Christmas 2027 is a Saturday and Christmas 2028, after a leap day, jumps to Monday.
| Year | 25 December |
|---|---|
| 2026 | Friday |
| 2027 | Saturday |
| 2028 | Monday |
| 2029 | Tuesday |
| 2030 | Wednesday |
| 2031 | Thursday |
| 2032 | Saturday |
| 2033 | Sunday |
Every method for finding a weekday is a compact way of counting these shifts from a known starting point. The Gregorian calendar repeats exactly every 400 years, because 400 years contain 146,097 days, which happens to be exactly 20,871 weeks. So a weekday rule only ever needs the date's position within a 400-year cycle.
Method 1: Zeller's congruence
Christian Zeller, a German clergyman and mathematician, published a single formula for the weekday in the 1880s. In its usual modern form for the Gregorian calendar:
h = (q + ⌊13(m + 1) / 5⌋ + K + ⌊K / 4⌋ + ⌊J / 4⌋ + 5J) mod 7
where q is the day of the month, m the month number, K the year within the century (the last two digits) and J the century (the year divided by 100, rounded down). Two details trip people up:
- January and February count as months 13 and 14 of the previous year. That puts the leap day at the end of the counting year, so the formula never has to ask whether a year is a leap year.
- The answer h runs from 0 for Saturday through 1 for Sunday up to 6 for Friday.
The term ⌊13(m + 1) / 5⌋ looks magical but is simply a neat way of adding up the irregular month lengths of March to the following February. The K and ⌊K / 4⌋ terms add one weekday per year plus one per leap year, and the J terms handle the Gregorian century rule, under which 1700, 1800 and 1900 are not leap years but 2000 is.
Worked example: 20 July 1969, the first Moon landing. q = 20, m = 7, K = 69, J = 19.
- ⌊13 × 8 / 5⌋ = ⌊20.8⌋ = 20
- ⌊69 / 4⌋ = 17 and ⌊19 / 4⌋ = 4
- 5J = 95
- Sum: 20 + 20 + 69 + 17 + 4 + 95 = 225
- 225 mod 7 = 1, which is Sunday.
Worked example: 4 July 1776. q = 4, m = 7, K = 76, J = 17. The sum is 4 + 20 + 76 + 19 + 4 + 85 = 208, and 208 mod 7 = 5, a Thursday.
The formula is easy for a computer and tedious in your head, which is why mental calculators prefer the next method.
Method 2: Conway's Doomsday rule
John Horton Conway, the Princeton mathematician, noticed that a set of easy-to-remember dates always share the same weekday within any given year. He called that weekday the year's doomsday. The memorable dates are:
| Month | Doomsday date | Memory aid |
|---|---|---|
| January | 3rd (4th in a leap year) | 3 in 3 years, 4 in the 4th |
| February | 28th (29th in a leap year) | Last day of February |
| March | 14th | Pi day, or "March 0" (last day of February) |
| April, June, August, October, December | 4th, 6th, 8th, 10th, 12th | 4/4, 6/6, 8/8, 10/10, 12/12 |
| May and September | 9th and 5th | "9 to 5 at the 7-Eleven" |
| July and November | 11th and 7th | 7/11 and 11/7 |
Finding a weekday then takes three steps.
- Century anchor. For the Gregorian calendar the anchors repeat every 400 years: 1800s Friday, 1900s Wednesday, 2000s Tuesday, 2100s Sunday.
- Year doomsday. Take the last two digits of the year. Count the twelves in it (a), the remainder (b), and the fours in that remainder (c). The doomsday is the anchor moved forward by a + b + c days.
- Count from the nearest doomsday date in the target month.
Worked example: 25 December 2026. The 2000s anchor is Tuesday. 26 contains two twelves (a = 2), remainder 2 (b = 2), and no fours in 2 (c = 0). Tuesday plus 4 is Saturday, so every doomsday date in 2026 is a Saturday, including 12 December. 25 December is 13 days later: 13 is one week and 6 days, and Saturday plus 6 is Friday. Christmas 2026 is a Friday.
Worked example: 20 July 1969, again. The 1900s anchor is Wednesday. 69 gives a = 5, b = 9, c = 2, total 16, which is 2 weeks and 2 days, so 1969's doomsday is Friday. The July doomsday date is the 11th, a Friday; the 20th is 9 days later, 1 week and 2 days, which lands on Sunday. Both methods agree, as they must.
With practice the rule takes a few seconds. The calculator shows both methods for any Gregorian date under "Working it out by hand", with the actual numbers plugged in, so you can use it to check your own arithmetic while learning.
The Julian calendar trap
The Gregorian calendar was introduced by Pope Gregory XIII in 1582 to fix the drift of the Julian calendar, which treats every fourth year as a leap year and so gains about three days every four centuries. Catholic countries in Europe jumped from Thursday 4 October 1582 straight to Friday 15 October 1582. The weekday sequence was not interrupted; only the day numbers jumped.
Other countries switched much later. Great Britain and its colonies, including those in North America, went from Wednesday 2 September 1752 to Thursday 14 September 1752. Russia switched in 1918, which is why the October Revolution of 1917 took place in November by the Gregorian calendar.
This matters whenever you read an old date. A Gregorian calendar extended backwards, called the proleptic Gregorian calendar and used by most software, gives the wrong weekday for a date that was written in the Julian calendar. A neat illustration is 23 April 1616:
| Calendar | Weekday of 23 April 1616 | Gregorian equivalent |
|---|---|---|
| Julian (as used in England) | Tuesday | 3 May 1616 |
| Gregorian (as used in Spain) | Saturday | 23 April 1616 |
An English parish register and a Spanish one could both carry that written date, ten days apart in reality. Zeller published a Julian version of his formula, in which the century terms ⌊J / 4⌋ + 5J are replaced by 5 + 6J, and the calculator uses it when you choose the Julian calendar. For 2 September 1752 in Britain the Julian formula gives a sum of 200, and 200 mod 7 = 4, Wednesday, matching the historical record; the calculator also shows the Gregorian equivalent, 13 September 1752.
The calculator's three calendar settings are:
- Gregorian, the default, for modern dates and for software-style proleptic dates.
- Julian before 1582, which uses the Julian calendar up to 4 October 1582 and the Gregorian from 15 October 1582, matching Catholic Europe.
- Julian, for any date written in the old style, such as British records before September 1752.
Julian Day Numbers: how software does it
Astronomers sidestep months entirely by counting days. The Julian Day Number (JDN, unrelated to the Julian calendar despite the name) counts days from 1 January 4713 BC in the Julian calendar. Noon on 1 January 2000 is JDN 2,451,545. Because the count is continuous, the weekday is just the remainder when JDN plus 1 is divided by 7, with 0 meaning Sunday. The calendar switch shows up neatly: Julian 4 October 1582 is JDN 2,299,160 and Gregorian 15 October 1582 is the next day, JDN 2,299,161.
The calculator works out the JDN for the calendar you choose, takes the weekday from it, and then checks the result against Zeller and, for Gregorian dates, Doomsday. Our test suite runs all three against each other for every third day from 1900 to 2100.
Finding dates like the fourth Thursday of November
Many holidays are defined by weekday rather than date. US Thanksgiving is the fourth Thursday of November and Memorial Day is the last Monday of May. To find the nth weekday of a month, find the weekday of the 1st, count forward to the first occurrence, then add whole weeks.
For November 2026, the 1st is a Sunday, so the first Thursday is the 5th and the fourth is the 26th. In 2027 the fourth Thursday is the 25th. For "last" rules, start from the final day of the month and count back: 31 May 2026 is a Sunday, so the last Monday is the 25th. The finder panel in the calculator does this for any month and year from 1 to 9999, defaulting to Thanksgiving, and the main result also names each date's position, such as "4th and last Friday of December 2026".
Tips and common mistakes
- Forgetting the January and February shift in Zeller's formula gives an answer that is wrong for those two months only, which makes the mistake hard to spot.
- Using % in a programming language with negative numbers. Some languages return a negative remainder for negative inputs. Variants of Zeller that subtract 2J need a true modulo.
- Treating 1900 as a leap year. It was not; 2000 was. Doomsday handles this through the century anchors.
- Reading an old British or American date as Gregorian. Dates before 14 September 1752 in British records are Julian unless marked "New Style".
- Assuming a 365-day shift. Across a 29 February a date moves by two weekdays, not one.
If you also need the week number of a date, read ISO week numbers explained or open the Week Number Calculator. For the number of days between two dates, use Date Difference, and to count forward or back by days, Date Arithmetic.
Sources
- Zeller, C. (1882). "Die Grundaufgaben der Kalenderrechnung auf neue und vereinfachte Weise gelöst." Württembergische Vierteljahrshefte für Landesgeschichte, 5.
- Zeller, C. (1887). "Kalender-Formeln." Acta Mathematica, 9, 131-136.
- Conway, J. H. (1973). "Tomorrow is the day after Doomsday." Eureka, 36, 28-31; and Berlekamp, Conway and Guy, Winning Ways for Your Mathematical Plays, chapter on calendar calculation.
- Inter gravissimas, papal bull of Gregory XIII (1582), establishing the Gregorian calendar.
- Calendar (New Style) Act 1750 (24 Geo. II c. 23), Great Britain, moving Britain and its colonies to the Gregorian calendar in September 1752.
- Meeus, J. (1998). Astronomical Algorithms, 2nd ed., chapter 7 (Julian Day and day of the week).
Related searches
- what day of the week was i born
- doomsday rule explained
- zeller congruence example
- day of the week formula
- julian to gregorian date conversion
- what day was july 4 1776
- september 1752 missing days
- how to calculate weekday mentally