Day of the Week Calculator

Date to day converter • 2026 edition

Zeller's Congruence Formula:

Show the calculator

\( h = \left(q + \left\lfloor\frac{13(m+1)}{5}\right\rfloor + K + \left\lfloor\frac{K}{4}\right\rfloor + \left\lfloor\frac{J}{4}\right\rfloor - 2J\right) \mod 7 \)

Where:

  • \( h \) = day of week (0=Saturday, 1=Sunday, 2=Monday, ..., 6=Friday)
  • \( q \) = day of month
  • \( m \) = month (3=March, 4=April, ..., 14=February)
  • \( K \) = year of century (\( \text{year} \bmod 100 \))
  • \( J \) = zero-based century (\( \left\lfloor \text{year}/100 \right\rfloor \))

This algorithm calculates the day of the week for any Gregorian calendar date. Note that in Zeller's congruence, January and February are treated as months 13 and 14 of the previous year.

Example: For January 1, 2026:

January becomes month 13 of 2025: \( q=1, m=13, \text{year}=2025 \)

\( K = 25, J = 20 \)

\( h = (1 + \lfloor\frac{13(13+1)}{5}\rfloor + 25 + \lfloor\frac{25}{4}\rfloor + \lfloor\frac{20}{4}\rfloor - 2(20)) \mod 7 \)

\( h = (1 + 36 + 25 + 6 + 5 - 40) \mod 7 = 33 \mod 7 = 5 \)

So January 1, 2026 is a Thursday (where 5=Thursday).

Date Input

Tip: ISO starts with Monday as 1

Options

Results

Thursday
Day of the Week
4
Day Number (1-7)
1
Week of Year
1
Day of Year
Yes
Leap Year
Attribute Value Description Significance
Week Mon Tue Wed Thu Fri Sat Sun

Comprehensive Day of the Week Guide

What is Day of the Week Calculation?

Day of the week calculation is the mathematical process of determining which day of the week corresponds to a specific date. This fundamental operation has been essential for centuries, from ancient calendar systems to modern computer algorithms. Various methods exist to perform this calculation, from simple lookup tables to complex mathematical formulas.

Zeller's Congruence Formula

Zeller's Congruence is one of the most famous algorithms for calculating the day of the week:

\( h = \left(q + \left\lfloor\frac{13(m+1)}{5}\right\rfloor + K + \left\lfloor\frac{K}{4}\right\rfloor + \left\lfloor\frac{J}{4}\right\rfloor - 2J\right) \mod 7 \)

Where:

  • \( h \) = day of week (0=Saturday, 1=Sunday, 2=Monday, ..., 6=Friday)
  • \( q \) = day of month
  • \( m \) = month (3=March, 4=April, ..., 14=February)
  • \( K \) = year of century (\( \text{year} \bmod 100 \))
  • \( J \) = zero-based century (\( \left\lfloor \text{year}/100 \right\rfloor \))

Calculation Methods
1
Zeller's Congruence: Mathematical formula that works for any Gregorian date. Handles month adjustments automatically.
2
Doomsday Algorithm: Developed by John Conway, this method uses "doomsday" dates that fall on the same day each year.
3
Key Value Method: Uses precomputed values for months and years to simplify calculations.
4
Reference Date: Calculate relative to a known date (e.g., January 1, 1900 was a Monday).
Calendar Systems

Different calendar systems require different calculation methods:

  • Gregorian Calendar: Introduced in 1582, currently used worldwide
  • Julian Calendar: Used before Gregorian, still used by some Orthodox churches
  • ISO 8601: International standard defining Monday as day 1 of the week
  • Hebrew Calendar: Lunisolar calendar with different weekday calculations
Day of Week Calculation Best Practices
  • Account for Calendar Changes: Be aware of the transition from Julian to Gregorian calendar
  • Handle Edge Cases: Verify calculations for month/year boundaries
  • Consider Time Zones: May affect the day boundary for international dates
  • Validate Inputs: Ensure valid dates before calculation
  • Test Historical Dates: Algorithms may differ for dates before calendar reforms

Day of Week Basics

What is Day of Week Calculation?

Determining the day of the week for a given date.

Formula

\( h = \left(q + \left\lfloor\frac{13(m+1)}{5}\right\rfloor + K + \left\lfloor\frac{K}{4}\right\rfloor + \left\lfloor\frac{J}{4}\right\rfloor - 2J\right) \mod 7 \)

Result: 0=Saturday, 1=Sunday, 2=Monday, ..., 6=Friday.

Key Rules:
  • January and February are treated as months 13 and 14 of previous year
  • Results vary by calendar system (Gregorian vs Julian)
  • ISO 8601 starts week with Monday as day 1

Strategies

Different Calendar Systems

Vary calculation based on calendar being used.

Calculation Process
  1. Identify the date and calendar system
  2. Apply appropriate formula for the calendar
  3. Adjust for month/year boundary cases
  4. Calculate modulo 7 for day of week
Considerations:
  • Gregorian calendar introduced in 1582
  • Julian calendar used before 1582 in most places
  • ISO 8601: Monday = 1, Sunday = 7
  • Some countries adopted Gregorian at different times

Day of Week Learning Quiz

Question 1: Multiple Choice - Basic Calculation

According to the ISO 8601 standard, what day of the week is represented by the number 1?

Solution:

The answer is B) Monday. According to the ISO 8601 international standard, Monday is designated as day 1 of the week, with Sunday being day 7. This standard is widely used in Europe and many other parts of the world for business and technical purposes.

Pedagogical Explanation:

This question highlights the importance of understanding different cultural and regional conventions for day numbering. While many countries start the week with Sunday as day 1, the ISO 8601 standard was developed to create a consistent international convention. This is particularly important in computing, international business, and technical applications where standardized formats are essential.

Key Definitions:

ISO 8601: International standard for date and time representations

Day Numbering: Assigning numeric values to days of the week

Standardization: Creating consistent international conventions

Important Rules:

• ISO 8601: Monday = 1, Sunday = 7

• Traditional US: Sunday = 1, Saturday = 7

• Cultural variations exist globally

Tips & Tricks:

• Always verify the standard being used in international contexts

• Remember ISO 8601 starts with Monday

• Consider audience when presenting day numbers

Common Mistakes:

• Confusing ISO standard with traditional numbering

• Assuming universal day numbering conventions

• Not clarifying which standard is being used

Question 2: Day of Week Formula Application

Using Zeller's Congruence, calculate the day of the week for March 14, 2024 (Pi Day). Show your work and identify the day.

Solution:

For March 14, 2024: q = 14, m = 3, year = 2024

Since March is month 3, no adjustment needed for month/year

K = 24 (year of century: 2024 mod 100)

J = 20 (zero-based century: floor(2024/100))

Applying Zeller's Congruence:

h = (14 + floor(13×(3+1)/5) + 24 + floor(24/4) + floor(20/4) - 2×20) mod 7

h = (14 + floor(52/5) + 24 + 6 + 5 - 40) mod 7

h = (14 + 10 + 24 + 6 + 5 - 40) mod 7

h = (59 - 40) mod 7 = 19 mod 7 = 5

In Zeller's system: 0=Saturday, 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thursday, 6=Friday

Therefore, March 14, 2024 is a Thursday.

Pedagogical Explanation:

This problem demonstrates the step-by-step application of Zeller's Congruence, one of the most elegant mathematical formulas for day-of-week calculation. The key insight is understanding how the formula accounts for the irregularities in our calendar system, particularly the varying month lengths and leap years. The modulo 7 operation ensures the result cycles through the 7 days of the week.

Key Definitions:

Zeller's Congruence: Algorithm for calculating day of the week

Modulo Operation: Finding remainder after division

Century Adjustment: Accounting for calendar reforms

Important Rules:

• January and February treated as months 13 and 14 of previous year

• h mod 7 gives day of week (0=Saturday to 6=Friday)

• Apply floor function to division results

Tips & Tricks:

• Remember to adjust January and February

• Carefully compute floor functions

• Double-check the day mapping system

Common Mistakes:

• Forgetting to adjust January and February months

• Incorrectly calculating floor functions

• Confusing day number mappings

Question 3: Word Problem - Historical Date

The Gregorian calendar was introduced in October 1582, replacing the Julian calendar. If Columbus landed in the Americas on October 12, 1492, what day of the week was it according to the calendar in use at that time? (Note: This was before the Gregorian reform, so use the Julian calendar).

Solution:

October 12, 1492 in the Julian calendar:

For Julian calendar calculation: q = 12, m = 10, year = 1492

K = 92 (1492 mod 100), J = 14 (floor(1492/100))

Using modified Zeller's for Julian calendar:

h = (12 + floor(13×11/5) + 92 + floor(92/4) + floor(14/4) - 14) mod 7

h = (12 + 28 + 92 + 23 + 3 - 14) mod 7

h = 144 mod 7 = 4

In Zeller's system: 4 = Wednesday

Therefore, October 12, 1492 was a Wednesday in the Julian calendar.

Pedagogical Explanation:

This problem illustrates the importance of understanding historical calendar systems when working with dates before 1582. The Julian calendar had a different leap year rule than the Gregorian, leading to slight differences in day calculations. For dates before the Gregorian reform, it's essential to use the calendar system that was in effect at that time, as modern calculators might apply the current Gregorian system.

Key Definitions:

Julian Calendar: Calendar system used before 1582

Gregorian Calendar: Current calendar system introduced in 1582

Calendar Reform: Change from Julian to Gregorian system

Important Rules:

• Dates before 1582 typically use Julian calendar

  • Gregorian reform skipped 10 days in October 1582
  • • Different countries adopted Gregorian at different times

    Tips & Tricks:

    • Identify the calendar system in use for historical dates

    • Consider the date of Gregorian adoption in different regions

    • Use appropriate formulas for different calendar systems

    Common Mistakes:

    • Applying Gregorian calculations to pre-1582 dates

    • Not considering regional adoption differences

    • Ignoring calendar reform impacts

    Question 4: Application-Based Problem - Pattern Recognition

    If January 1, 2026 is a Thursday, what day of the week will January 1, 2027 be? Explain your reasoning, considering whether 2026 is a leap year.

    Solution:

    Step 1: Determine if 2026 is a leap year

    2026 ÷ 4 = 506.5, so 2026 is not evenly divisible by 4

    Therefore, 2026 is not a leap year (it has 365 days)

    Step 2: Calculate the day shift

    365 days = 52 weeks + 1 day

    Step 3: Apply the shift

    January 1, 2026: Thursday

    January 1, 2027: Thursday + 1 day = Friday

    Therefore, January 1, 2027 will be a Friday.

    Pedagogical Explanation:

    This problem demonstrates the relationship between calendar years and day progression. Since a regular year has 365 days, which is 52 weeks plus 1 day, each subsequent year begins one day later in the week cycle. However, leap years have 366 days (52 weeks + 2 days), causing the following year to begin two days later in the week cycle. This pattern is essential for understanding long-term date relationships.

    Key Definitions:

    Leap Year: Year with 366 days, occurring every 4 years

    Day Progression: How days shift from year to year

    Calendar Cycle: Repetitive pattern of days and dates

    Important Rules:

    • Regular year: day advances by 1 (365 = 52×7 + 1)

    • Leap year: day advances by 2 (366 = 52×7 + 2)

    • Leap year: divisible by 4, except century years not divisible by 400

    Tips & Tricks:

    • Remember: 365 ÷ 7 = 52 remainder 1

    • For leap years: 366 ÷ 7 = 52 remainder 2

    • Check leap year rules before calculating

    Common Mistakes:

    • Forgetting to check if a year is a leap year

    • Assuming all years advance by the same number of days

    • Incorrect leap year calculation

    Question 5: Multiple Choice - Doomsday Algorithm

    Which of the following dates always falls on the same day of the week as the "doomsday" in John Conway's algorithm?

    Solution:

    The answer is D) All of the above. In Conway's Doomsday algorithm, certain memorable dates always fall on the "doomsday" for any given year. These include: 4/4 (April 4), 6/6 (June 6), 8/8 (August 8), 10/10 (October 10), 12/12 (December 12), as well as 5/9 and 9/5, 7/11 and 11/7. For January and February, the doomsday is January 3 (or January 4 in leap years) and February 28 (or February 29 in leap years).

    Pedagogical Explanation:

    The Doomsday algorithm is a human-executable method for calculating the day of the week. The concept relies on memorizing "anchor" dates that fall on the same day each year. These dates are chosen to be easily memorable (like 4/4, 6/6, 8/8, etc.). Once you know the "doomsday" for a particular year, you can calculate the day of the week for any date by counting forward or backward from the nearest doomsday date.

    Key Definitions:

    Doomsday Algorithm: Mental calculation method by John Conway

    Doomsday: Reference day of the week for a given year

    Anchor Dates: Memorized dates that share the doomsday

    Important Rules:

    • Even months: m/m (4/4, 6/6, 8/8, 10/10, 12/12)

    • Odd months: 5/9, 9/5, 7/11, 11/7 (mnemonic: "working 9 to 5")

    • January: 3rd (or 4th in leap years), February: 28th (or 29th in leap years)

    Tips & Tricks:

    • Remember "working 9 to 5" for May/September and July/November

    • Even months are easy: 4/4, 6/6, 8/8, 10/10, 12/12

    • Use doomsday as reference point for other dates

    Common Mistakes:

    • Forgetting the special cases for January and February

    • Confusing the anchor dates

    • Not accounting for leap years in February

    Day of the Week Calculator

    FAQ

    Q: Why do some historical dates have different days of the week when calculated with modern algorithms?

    A: The discrepancy occurs due to calendar reforms, particularly the transition from the Julian to the Gregorian calendar in 1582. The Julian calendar accumulated an error of about 1 day every 128 years, causing seasonal drift. When Pope Gregory XIII introduced the Gregorian calendar:

    • 10 days were skipped (October 4, 1582 was followed by October 15, 1582)

    • The leap year rule was refined (century years not divisible by 400 are not leap years)

    • Different countries adopted the change at different times (some as late as the 20th century)

    Therefore, for dates before calendar reforms, you must use the calendar system in effect at that time. For example, October 12, 1492 (Columbus's landing) was calculated using the Julian calendar, which gives a different result than using the modern Gregorian system.

    Q: How do computers accurately calculate days of the week for any date?

    A: Modern computers use sophisticated algorithms that account for calendar complexities:

    Zeller's Congruence: A mathematical formula that works for the Gregorian calendar, accounting for month adjustments and leap years.

    Julian Day Number (JDN): Converts any date to a continuous count of days since January 1, 4713 BCE, then uses modulo 7 for day of week.

    Unix Time: Seconds since January 1, 1970, with leap seconds handled by the system.

    Library Functions: Most programming languages provide built-in functions (like JavaScript's Date.getDay()) that handle all calendar complexities internally.

    These implementations consider leap years, calendar reforms, and time zones to provide accurate calculations across a wide range of dates.

    About

    Day of Week Research Team
    This calculator was created
    This calculator was created by our General & Utility Calculators Team , may make errors. Consider checking important information. Updated: April 2026.