What the weekday of a date really depends on
The weekday is the only part of a date that never resets. Years restart, months restart, days of the month restart, but the seven-day cycle has run without interruption since long before any calendar reform, and it survived the Gregorian changeover untouched — Thursday 4 October 1582 was followed directly by Friday 15 October 1582. Ten calendar dates vanished; not one weekday did. That is why the weekday of any date is computable from the date alone, with no lookup table.
The reason a formula exists at all is that the Gregorian calendar repeats exactly every 400 years. Four hundred Gregorian years contain 400 × 365 + 97 = 146,097 days, and 146,097 is divisible by seven (it is 7 × 20,871). So the calendar's weekday pattern has a period of exactly 400 years, and a formula only has to encode one cycle. The Julian calendar repeats every 28 years for the same reason, since 28 × 365.25 = 10,227 days = 7 × 1,461.
You need this in three situations. Genealogists check whether a recorded baptism or marriage date is plausible — a Sunday baptism in a parish register is expected, a Sunday burial is not. Historians need to know which calendar a document used, because an English letter dated 1 March 1700 and a French one dated the same day are eleven days apart. And most people simply want to know which day of the week they were born on.
How Zeller's congruence works, term by term
Christian Zeller published this congruence in 1882 as a way to do the calculation by hand. Every term of it is doing one identifiable job.
The month shift. January and February are relabelled as months 13 and 14 of the previous year. This is the same trick the Julian Day Number formula uses: it moves the leap day to the end of the year, so that months 3 through 14 have a completely regular length pattern and no term of the formula has to know about February at all.
The month term ⌊13(m + 1)/5⌋. Months in the shifted year alternate 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28-or-29 days. Modulo 7 what matters is the cumulative offset, and 13/5 = 2.6 days per month is precisely the average excess of a month over four weeks. The floor of 13(m + 1)/5 reproduces the actual cumulative offsets exactly, which is the small miracle at the centre of the formula.
K + ⌊K/4⌋. Each ordinary year advances the weekday by one, because 365 = 52 × 7 + 1. Each leap year advances it by two. So over K years within a century the total advance is K plus one extra for every leap year passed, which is ⌊K/4⌋.
⌊J/4⌋ + 5J. This is the Gregorian century correction. A Julian century of 36,525 days is 5 more than a multiple of seven, hence 5J. But the Gregorian rule drops three leap days per 400 years, and ⌊J/4⌋ restores the centuries that are leap years — 1600, 2000, 2400. In the Julian calendar there is no such exception, and those two terms collapse to the single term 5 − J.
The residue. Take the sum modulo 7. Zeller's convention is that h = 0 is Saturday, which looks arbitrary until you notice it makes the arithmetic come out without an offset constant. To reach the ISO 8601 numbering, where Monday is 1 and Sunday is 7, compute ((h + 5) mod 7) + 1.
Worked example: what day was 15 June 1990?
June is month 6, which is already ≥ 3, so no shift is needed: q = 15, m = 6, Y = 1990.
- Split the year. K = 1990 mod 100 = 90. J = ⌊1990 / 100⌋ = 19.
- Month term. ⌊13 × (6 + 1) / 5⌋ = ⌊91 / 5⌋ = ⌊18.2⌋ = 18.
- Year terms. K = 90 and ⌊K / 4⌋ = ⌊22.5⌋ = 22.
- Century terms. ⌊J / 4⌋ = ⌊19 / 4⌋ = 4, and 5J = 5 × 19 = 95.
- Sum. 15 + 18 + 90 + 22 + 4 + 95 = 244.
- Reduce. 244 = 7 × 34 + 6, so h = 6. Counting 0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday.
Check it against the Julian Day Number, which is an entirely independent route. JDN(1990-06-15) = 2,448,058. Since 7 × 349,722 = 2,448,054, the remainder is 2,448,058 − 2,448,054 = 4. Under the standing identity that a Julian Day Number divisible by 7 is a Monday, a remainder of 4 counts Monday, Tuesday, Wednesday, Thursday, Friday — so Friday. The two methods agree.
Now do a January date, where the shift bites. For 1 January 2000: m becomes 13 and Y becomes 1999, so K = 99 and J = 19. Month term ⌊13 × 14 / 5⌋ = ⌊36.4⌋ = 36. Sum: 1 + 36 + 99 + 24 + 4 + 95 = 259 = 7 × 37 exactly, so h = 0, which is Saturday. That is the correct and famous answer for the first day of 2000.
Reading the result: repeats, and the 6-11-6-5 pattern
The most useful thing to notice about the weekday of a fixed date is how it advances. In a common year it moves forward one day; in a leap year it moves forward two, if the date falls after 28 February. That produces the repeat pattern the table below shows: for a date in the second half of the year, the same weekday returns after 6 years, then 11, then 6, then 5, and the cycle of 28 years repeats — until a century year that is not a leap year interrupts it. The years 1900 and 2100 break the pattern; 2000 does not, because it is divisible by 400.
Two useful sanity checks. First, 29 February can only fall on a given weekday every 28 years within a normal stretch of the calendar, because it only exists in leap years — 2024, 2052, 2080 are all Thursdays, while 2100 breaks the run. Second, the number of Friday the 13ths per year is always between one and three, and over a full 400-year Gregorian cycle the 13th falls on a Friday slightly more often than on any other weekday: 688 times out of 4,800, against 684 or 687 for the others. That result comes straight from the 400-year periodicity and is the reason the coincidence is not evenly distributed.
If your date is before 1752 and comes from a British, American colonial or Russian source, read it in the Julian column. Britain's Calendar (New Style) Act 1750 moved the country from the Julian to the Gregorian calendar in September 1752, dropping eleven days, and also moved the start of the legal year from 25 March to 1 January. A date written "12 February 1719/20" in an English register is using both conventions at once.
Doomsday anchors: the last day of February and its weekday-mates
| Month | Anchor date | Memory hook |
|---|---|---|
| January | 3rd (common year), 4th (leap year) | 3 years in 4 it is the 3rd |
| February | 28th (common), 29th (leap) | The last day of the month |
| March | 14th | Pi day |
| April | 4th | 4/4 |
| May | 9th | 9-to-5 at 7-Eleven |
| June | 6th | 6/6 |
| July | 11th | 7-Eleven |
| August | 8th | 8/8 |
| September | 5th | 9-to-5 |
| October | 10th | 10/10 |
| November | 7th | 7-Eleven reversed |
| December | 12th | 12/12 |
Every date in this column falls on the same weekday within a given year. In 2026 that weekday is Saturday, so 4 April, 6 June, 8 August, 10 October and 12 December 2026 are all Saturdays. Verify any of them above.
Where weekday calculations go wrong
- Forgetting the January and February shift. This is the single most common error in a hand calculation. January 2000 is month 13 of 1999, so K is 99 and not 0, and the century term changes with it.
- Using truncating division instead of floor division for BC years. With negative year numbers, ⌊−1/100⌋ is −1, not 0. The calculator uses proper floor division throughout, but a spreadsheet formula using INT versus TRUNC will disagree.
- Applying the Gregorian formula to a pre-1582 date. Nothing stops you, and the result is a valid proleptic Gregorian weekday, but it is not the weekday the document's writer would have named. Julius Caesar's assassination on 15 March 44 BC was a Julian date.
- Assuming the same date repeats every seven years. It does not, because leap years advance the weekday by two. The gaps are 6, 11, 6 and 5 years, summing to 28.
- Mixing up ISO and US weekday numbering. ISO 8601 makes Monday 1 and Sunday 7; most spreadsheet WEEKDAY functions default to Sunday = 1. The ISO week number calculator depends on getting this right, because ISO week 1 is defined by the first Thursday of the year.
Other routes to the same answer
Zeller's congruence is not the only method, just the most compact. The Julian Day Number route is arguably cleaner: convert the date to a JDN and take it modulo 7, since the day count has never skipped. That is the method behind the age in days calculator, and it is what the Unix timestamp converter uses to name the weekday of an epoch value. The two approaches agree everywhere, which is a useful mutual check.
John Conway's doomsday algorithm, published in 1973, is the method to learn if you want to do this mentally at speed. It uses the table above: within any year, a set of easily remembered dates all share one weekday, called that year's doomsday. Find the doomsday for the year, then count from the nearest anchor. Practised calculators do it in under two seconds.
For the calendar arithmetic that sits around a weekday question, the leap year calculator settles which years carry the extra day, and the week number calculator converts a date to its ISO week. If your question is really about how much time separates two dates rather than which weekday one falls on, use the day count calculator instead.
One caution about the far future and the deep past: this calculator assumes today's Gregorian rule holds indefinitely in both directions. The rule accumulates about one day of error against the tropical year every 3,200 years, so a date in the year 5000 computed here is a calendar statement, not an astronomical one. Over that horizon the calendar itself will have been amended.
