Tool to find the day of the week of a given date. Each date corresponds to a day of the week on a given calendar. There is an algorithm to calculate the day of the week of a date.
Day of the Week of a Date - dCode
Tag(s) : Date and Time, Fun/Miscellaneous
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The day of the week associated with a date is one of the 7 names of the weekly cycle (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday) assigned to a given calendar day according to a precise calendar (in practice the Gregorian calendar for modern dates).
Calculating the day of the week associated with a date (day/month/year) depends on the calendar used (the Gregorian calendar after its local adoption, the Julian calendar before, or the proleptic Gregorian calendar if the user is applying its rules retrospectively).
The general principle is to start with a reference date whose day is known, count the number of days between this reference date and the desired date, and then reduce this number modulo 7.
Example: If today is a Monday, in 15 days it will be a Tuesday because $ 15 \bmod 7 = 1 $, and Monday $ +1 $ equals Tuesday.
There are mental calculation algorithms (for example, variants of Zeller's or Doomsday's congruence) that combine the day, month, and year to directly produce a value modulo 7. One possible convention is: 0 for Monday, 1 for Tuesday, 2 for Wednesday, 3 for Thursday, 4 for Friday, 5 for Saturday, and 6 for Sunday (other conventions exist).
Example: What day was January 1, 2000? It was a Saturday!
For dates prior to 1600, dCode adopts the proleptic Gregorian calendar.
The proleptic Gregorian calendar is the Gregorian calendar applied retrospectively to dates prior to 1582, as if its rules had always existed. The actual Gregorian calendar begins at the time of its adoption (in 1582, then gradually in different countries). Its proleptic version consists of mathematically extending the same rules (particularly those of leap years) to earlier periods, before 1582, even if they were not used at the time.
To obtain the day of the week of birth, the user enters the day, month, and year. dCode then determines the difference in days between this date and a known reference date (often January 1, 1970), taking into account leap years and the applicable calendar, and then applies a modulo 7 reduction to identify the corresponding day.
Zeller's formula allows you to find the weekday from a day = $ d $, month = $ m $, year = $ Y $ of the Gregorian calendar.
If the month is 1 or 2, treat it as month 13 or 14 of the previous year.
Example: If $ m = 1 $, then $ m = 13 $ and $ Y = Y - 1 $
Calculate: $ K = Y \bmod 100 $ (the last two digits of the year), $ J = (Y-K)/100 $ (the number of centuries), and $$ h = (d + \lfloor 2.6m - 0.2 \rfloor + K + \lfloor K/4 \rfloor + \lfloor J/4 \rfloor + 5J) \bmod 7 $$
The number $ h $ gives the day according to these values: 0: Saturday, 1: Sunday, 2: Monday, 3: Tuesday, 4: Wednesday, 5: Thursday, 6: Friday
There are two main differences.
The first concerns the rule for leap years: in the Julian calendar, any year divisible by 4 is a leap year; in the Gregorian calendar, a year divisible by 100 is only a leap year if it is also divisible by 400. This correction aims to better align the civil year with the solar year and prevents a gradual drift of the seasons.
The second difference, which stems from the first, is the initial correction made when the Gregorian calendar was adopted in 1582: 10 days were removed to compensate for the accumulated drift. In France, the day after December 9, 1582, was December 20, 1582. In much of Catholic Europe, the day after Thursday, October 4, 1582, was Friday, October 15, 1582 (this is the convention used by dCode). Other countries adopted the calendar later, with different transition dates.
When the calendar used could be confusing, historians systematically specify the location and the calendar system employed (Julian, Gregorian, or other).
For certain transitional periods, they sometimes use dual dating, indicating the date in both the old (Julian) and new (Gregorian) styles.
dCode retains ownership of the "Day of the Week of a Date" source code. Any algorithm for the "Day of the Week of a Date" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Day of the Week of a Date" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Day of the Week of a Date" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Day of the Week of a Date" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Day of the Week of a Date on dCode.fr [online website], retrieved on 2026-03-21,