Time, Date, Navigation & Astronomy Date Math & Business Calendars Zeller's congruence (1882); ISO 8601 weekday numbering

Day of the Week Calculator

Enter any date and this calculator returns the weekday, the ISO 8601 weekday number, the day of the year and the Julian Day Number, for the Gregorian calendar or the Julian one. It also shows every intermediate term of Zeller's congruence, so you can follow the arithmetic and eventually do it in your head. Use it to find the day you were born, to check a date in a parish register against the calendar in use at the time, or to see which future years repeat today's weekday pattern.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
YearFour-digit year; use the astronomical convention where 1 BC is year 0.1990
MonthMonth number, 1 for January through 12 for December.6
Day of monthDay of the month; a day beyond the month's length is clamped and flagged.15
CalendarPick the calendar the date was actually written in; historical records before 1752 in Britain are Julian.Gregorian (civil calendar since 1582)
Years to scan for a repeatHow far forward to look for years in which this same date falls on the same weekday.40

It returns

  • Day of the week — The weekday on which this date falls in the calendar you selected.
  • ISO 8601 weekday number — Monday is 1 and Sunday is 7, as defined by ISO 8601.
  • Day of the year
  • Julian Day Number — Continuous day count from 4713 BC, the value the weekday is derived from.
  • Zeller's h term — The residue from Zeller's congruence, where 0 is Saturday and 1 is Sunday.
  • Next year this date repeats the weekday

The formula

h=(q+13(m+1)5+K+K4+J4+5J)mod7
h=(q+13(m+1)5+K+K4+5J)mod7

In plain text: h = (q + ⌊13(m + 1)/5⌋ + K + ⌊K/4⌋ + ⌊J/4⌋ + 5J) mod 7, with h = 0 → Saturday

  • hWeekday residue: 0 Saturday, 1 Sunday, 2 Monday … 6 Friday (0–6)
  • qDay of the month (1–31)
  • mShifted month: March = 3 … December = 12, January = 13 and February = 14 of the preceding year (3–14)
  • KYear within the century, Y mod 100 (after the January/February shift) (0–99)
  • JCentury number, ⌊Y/100⌋ (after the shift) (integer)

For the Julian calendar the two century terms ⌊J/4⌋ + 5J are replaced by 5 − J. Every division is a floor division.

Updated Category Date Math & Business Calendars Verified against published test cases Reading time 11 min

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.

  1. Split the year. K = 1990 mod 100 = 90. J = ⌊1990 / 100⌋ = 19.
  2. Month term. ⌊13 × (6 + 1) / 5⌋ = ⌊91 / 5⌋ = ⌊18.2⌋ = 18.
  3. Year terms. K = 90 and ⌊K / 4⌋ = ⌊22.5⌋ = 22.
  4. Century terms. ⌊J / 4⌋ = ⌊19 / 4⌋ = 4, and 5J = 5 × 19 = 95.
  5. Sum. 15 + 18 + 90 + 22 + 4 + 95 = 244.
  6. 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

The doomsday method exploits the fact that these dates always share a weekday within any given year. Memorise the list and you only need one anchor per year.
MonthAnchor dateMemory hook
January3rd (common year), 4th (leap year)3 years in 4 it is the 3rd
February28th (common), 29th (leap)The last day of the month
March14thPi day
April4th4/4
May9th9-to-5 at 7-Eleven
June6th6/6
July11th7-Eleven
August8th8/8
September5th9-to-5
October10th10/10
November7th7-Eleven reversed
December12th12/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.

Frequently asked questions

What day of the week was I born on?

Enter your birth year, month and day above and read the primary output. The calculator uses Zeller's congruence with the Gregorian calendar, which is correct for any birth date after 1752 in Britain and its former colonies, after 1582 in most of Catholic Europe, and after 1918 in Russia. It also shows the ISO weekday number and the day of the year.

Why does Zeller's formula treat January as month 13?

Because it moves the leap day out of the middle of the year. If the year starts in March, then 29 February becomes the very last day of the year, and every earlier month has a fixed length. That lets the single term ⌊13(m + 1)/5⌋ reproduce all the cumulative month offsets without any special case for February.

How often does the same date fall on the same weekday?

The gaps run 6, 11, 6 and 5 years, adding to a 28-year cycle, and the exact sequence depends on where the leap years land relative to your date. A common year advances the weekday by one day and a leap year by two, which is what produces the irregular gaps. Century years that are not leap years — 1900, 2100, 2200 — interrupt the pattern.

Which calendar should I choose for a historical date?

Choose the calendar in use where the document was written. Catholic Europe switched in October 1582; Britain and its American colonies in September 1752; Russia in February 1918; Greece in 1923. If a source says a date is "Old Style" or "O.S.", it is Julian. Switching the selector above shows you how far apart the two calendars place the same weekday.

What is the ISO weekday number?

ISO 8601 numbers weekdays from Monday = 1 to Sunday = 7. It differs from the common spreadsheet default, which numbers Sunday = 1 through Saturday = 7, and from Zeller's own residue, where 0 is Saturday. The ISO numbering matters because ISO week numbering is defined in terms of Thursdays, so getting the offset wrong shifts week numbers by a full week.

Can this handle dates before the year 1?

It handles years down to 1 with the Julian calendar selected. For BC dates you would need the astronomical convention in which 1 BC is year 0 and 2 BC is year −1, and the input minimum here is 1, so the calculator does not accept them. The Julian Day Number route in the astronomical literature is the correct tool for pre-Christian dates.

Why is Friday the 13th slightly more common than other Friday dates?

Because the Gregorian calendar has a 400-year period of 146,097 days, and that number is divisible by seven, so the pattern repeats exactly. Counting all 4,800 thirteenths in one full cycle, 688 fall on a Friday, more than on any other weekday. The asymmetry comes from the century-year leap exception, which is what stops the distribution being even.

Does the weekday sequence ever break?

No. When Catholic Europe adopted the Gregorian calendar, Thursday 4 October 1582 was followed by Friday 15 October 1582 — ten dates disappeared, but the weekday cycle continued unbroken. Every subsequent national adoption did the same. That unbroken chain is exactly what makes a single formula work across both calendars.

References