Free Online Calc

How to work out the day of the week for any calendar date

Be the first to rate this page.

Zeller’s congruence finds the weekday of any Gregorian date from a single formula, with no calendar or lookup table needed. For 20 July 1969, the day Apollo 11 landed on the Moon, the formula returns weekday code 1, which maps to Sunday — matching the historical record. The same formula run on 25 December 2026 returns Friday.

What is the worked calculation for 20 July 1969?

For 20 July 1969: since the month (July, month 7) is 3 or greater, no year adjustment is needed, so use q = 20 (day), m = 7 (month), K = 69 (year within century, 1969 mod 100), and J = 19 (zero-based century, 1969 ÷ 100 rounded down). Compute each term: q = 20; ⌊13(m+1)/5⌋ = ⌊13 × 8 / 5⌋ = ⌊20.8⌋ = 20; K = 69; ⌊K/4⌋ = ⌊69/4⌋ = 17; ⌊J/4⌋ = ⌊19/4⌋ = 4; 5J = 95. Summing: 20 + 20 + 69 + 17 + 4 + 95 = 225. Dividing 225 by 7 leaves a remainder of 1, and code 1 in Zeller’s convention (0 = Saturday, 1 = Sunday, 2 = Monday …) is Sunday — 20 July 1969 was a Sunday.

How do I apply Zeller’s congruence myself?

For any date, first check the month: if it is January or February, treat it as month 13 or 14 of the *previous* year (so 14 February 2026 is computed as day 14, month 14, of year 2025) — this shift lets the formula treat every year as starting in March, which keeps the leap-year adjustment inside a single term. Then compute q + ⌊13(m+1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J, take the result modulo 7, and read the weekday off the 0-to-6 code. The date difference calculator and age calculator report a weekday for any entered date without requiring this manual arithmetic.

How do I check a weekday result?

An independent cross-check is the “doomsday” method: a small set of dates always falls on the same weekday within a given year — 4/4, 6/6, 8/8, 10/10, 12/12, 9/5, 5/9, 7/11, and 11/7 among them. For 2026, each of 4 April, 11 July, and 12 December computed independently lands on a Saturday, so any other 2026 date can be sanity-checked by counting whole weeks forward or backward from the nearest doomsday date. 25 December 2026 is 13 days after 12 December (a Saturday); 13 days is 1 week and 6 days, so 6 weekdays past Saturday lands on Friday — matching the Zeller’s congruence result above.

What mistakes produce a wrong weekday?

The most common mistake is forgetting the January/February shift — using the calendar year and month number directly for a date in those two months miscounts the leap-year term and can shift the answer by a day. A second is mixing up the weekday code convention; Zeller’s original formula numbers Saturday as 0, not Sunday or Monday as many programming date libraries do, so the numeric result must be mapped through the correct table before it is read as a weekday name. A third is applying integer division incorrectly — ⌊13(m+1)/5⌋ requires the fraction to be rounded *down*, not to the nearest whole number, and rounding 20.8 to 21 instead of 20 changes the final remainder. A fourth is reusing the K and J terms without recomputing them for the shifted year — for a January or February date, K and J must come from the *adjusted* year (one less than the calendar year), not the original calendar year, since the whole point of the shift is to move those two months into the previous year’s arithmetic.

What does this formula not determine?

This formula computes the weekday for a proleptic Gregorian calendar date. For dates before a given country’s adoption of the Gregorian calendar (commonly 1582 onward, but as late as the early 20th century in some countries), a separate Julian-calendar version of the formula is needed, since the two calendars disagree on which weekday falls on which date going back far enough. It answers only “what weekday was/is this date,” not a historical claim about which calendar was actually in civil use on that date in a given place.

Source for the external fact

The U.S. Naval Observatory explains that a Gregorian calendar date corresponds to a continuous day count (the Julian Date), and that the weekday follows from that day count modulo 7, in its Julian Date reference — the same principle Zeller’s congruence applies in a single closed-form arithmetic expression instead of a running count.

A reference table of worked dates

Running the identical formula on each date below, with its own q, m, K, and J values, produces every row.

DateZeller codeWeekday
1 January 20000Saturday
20 July 19691Sunday
4 July 17765Thursday
25 December 20266Friday
1 March 21002Monday

A second worked example that crosses the January/February shift

For 14 February 2026, the month-adjustment rule applies: because February is month 2 (less than 3), the formula treats the date as day 14 of month 14 of the year 2025, not year 2026. Using q = 14, m = 14, K = 25 (2025 mod 100), J = 20 (2025 ÷ 100, rounded down): ⌊13 × 15 / 5⌋ = ⌊39⌋ = 39; K = 25; ⌊25/4⌋ = 6; ⌊20/4⌋ = 5; 5 × 20 = 100. Summing 14 + 39 + 25 + 6 + 5 + 100 = 189, and 189 ÷ 7 = 27 exactly, remainder 0 — code 0 is Saturday. 14 February 2026 is indeed a Saturday, confirming the shifted-year computation was applied correctly.

Why the formula treats March as the start of its internal year

Shifting January and February into the previous year’s months 13 and 14 means every date the formula actually computes falls in a month numbered 3 through 14, all of them after any 29 February that might occur — so the leap-day term never has to be checked mid-formula for the two months where it would otherwise matter most. This is a deliberate design choice by Christian Zeller, not an approximation: it moves the leap-year sensitivity entirely into the K and J terms, which already encode the exact century rule described in the leap-year guide linked above.

A software date library gives the same answer without manual arithmetic

Most programming languages’ date libraries compute a weekday internally using an equivalent running day-count method rather than Zeller’s specific formula, but they must agree on every date, since both approaches describe the same physical calendar. Cross-checking the 20 July 1969 result against a standard library date function returns the identical answer, Sunday — the value worked out by hand above with Zeller’s congruence — which is the kind of independent confirmation worth doing once when implementing the formula manually, such as in a spreadsheet without a native weekday function.

Why the Gregorian calendar’s weekday pattern repeats exactly every 400 years

A complete 400-year Gregorian cycle contains exactly 97 leap years and 303 common years (as established by the century rule in the leap-year guide linked above), giving 97 × 366 + 303 × 365 = 146,097 days in total. Dividing that figure by 7 gives exactly 20,871 — a whole number, with no remainder — which means 400 years is an exact whole number of weeks. As a direct consequence, any given calendar date falls on the identical weekday every 400 years: 1 January 2000 was a Saturday, and 1 January 2400 will also be a Saturday, computable either by running Zeller’s congruence directly on the year 2400 or by simply noting the 400-year repeat established by this day-count arithmetic.

Related calculators

Check any specific date’s weekday directly with the date difference calculator, add or subtract days across a weekday boundary with the add-days calculator, and see the same underlying leap-year term explained fully in the leap-year rule guide.

Enter your values, review the result, then use it with confidence.

Rate this page

Be the first to rate this page.