Find the Day of a Date using this Calendar Formula
You can figure out what day of the week any date falls on. No calendar needed. Just arithmetic.
I’m not talking about memorizing tricks or using apps. I mean a genuine mathematical formula that works for any date after 1582. It takes about 30 seconds once you know it.
But before we get to the formula, we need to understand why our calendar works the way it does. The history matters here. It explains why the math looks the way it does.
The Problem with Calendars
A calendar has one job: keep our dates aligned with the seasons. Plant crops in spring. Harvest in fall. Celebrate the same holidays at the same astronomical times each year.
Sounds simple. It’s not.
The Earth takes approximately 365.2422 days to orbit the Sun. Not 365 days. Not 365.25 days. Exactly 365.2422 days. That fractional part causes all the trouble.
If you use a 365-day calendar, you lose about a quarter day every year. After four years, you’re a full day behind. After a century, you’re 24 days off. Your “spring equinox” is now happening in late winter. Your harvest festival falls before the crops are ready.
Every civilization that developed a calendar had to grapple with this problem. The solutions they invented tell you a lot about their priorities.
Julius Caesar’s Solution
In 46 BC, Julius Caesar hired an Alexandrian astronomer named Sosigenes to fix the Roman calendar. The old Roman calendar was a mess. Politicians would add or remove days to extend their terms or mess with election timing. Seriously. Calendar manipulation was a political tool.
Sosigenes proposed something elegant. Use a 365-day year, but add one extra day every four years. This “leap year” would account for the extra quarter day that accumulates annually.
The math: \( 365.25 \) days per year on average. Close enough to 365.2422, right?
Not quite. But close enough that nobody noticed for centuries.
Caesar implemented this in what we now call the Julian Calendar. He also had to add 90 extra days to 46 BC to realign the calendar with the seasons. That year was 445 days long. Romans called it “the year of confusion.”
The Julian Calendar worked well. It spread across Europe with the Roman Empire and persisted for over 1,600 years. But that small error, the difference between 365.25 and 365.2422, kept accumulating.
The Drift
The error is \( 365.25 – 365.2422 = 0.0078 \) days per year.
Tiny. Almost nothing. But over time, it adds up.
Every \( \frac{1}{0.0078} \approx 128 \) years, the Julian Calendar drifted one full day behind the astronomical reality. By the 1500s, the calendar had accumulated about 10 days of error.
This mattered because of Easter.
Easter is tied to the spring equinox. The Council of Nicaea in 325 AD fixed the equinox at March 21. But by the 16th century, the actual astronomical equinox was happening on March 11. Easter was being celebrated at the wrong time.
For the Catholic Church, this was a crisis. Easter is the most important holiday in Christianity. Getting it wrong felt like a theological failure.
Pope Gregory’s Fix

In 1582, Pope Gregory XIII assembled a commission to solve the calendar problem once and for all. The lead mathematician was Christopher Clavius, a German Jesuit who was one of the most respected astronomers of his era.
Clavius proposed two changes.
First, delete 10 days from 1582 to realign the calendar with the equinox. Thursday, October 4, 1582 was followed immediately by Friday, October 15, 1582. Ten days just vanished. People who went to bed on October 4 woke up on October 15.
Second, modify the leap year rule to prevent future drift. The new rule: a year is a leap year if it’s divisible by 4, except for century years. Century years are leap years only if divisible by 400.
So 1600 was a leap year (divisible by 400). But 1700, 1800, and 1900 were not (divisible by 100 but not 400). The year 2000 was a leap year. The year 2100 will not be.
This rule means we skip 3 leap years every 400 years, compared to the Julian system. The average year length becomes:
$$\frac{365 \times 400 + 97}{400} = \frac{146097}{400} = 365.2425 \text{ days}$$
That’s remarkably close to 365.2422. The Gregorian Calendar drifts by only one day every 3,236 years. We won’t need another calendar reform until around the year 4818.
The Adoption Chaos
The Gregorian Calendar was implemented immediately in Catholic countries: Spain, Portugal, Italy, and Poland adopted it in October 1582. France followed in December. Catholic Germany came on board in 1583.
Protestant countries refused. They saw it as a Catholic plot. “Better to disagree with the Sun than agree with the Pope,” supposedly said one German Protestant leader.
Britain and its colonies (including what would become America) didn’t adopt the Gregorian Calendar until 1752, by which point they had to delete 11 days instead of 10. There were riots. People thought the government had stolen days from their lives.
Russia held out until 1918. Greece waited until 1923. Some Orthodox churches still use the Julian Calendar for religious purposes.
This is why George Washington has two birthdays. He was born on February 11, 1731 under the Julian Calendar. When Britain adopted the Gregorian Calendar, that date shifted to February 22, 1732. (The year changed because Britain also moved New Year’s Day from March 25 to January 1.)
The calendar we now use globally became standard only in the 20th century. It took 340 years for humanity to agree on how to count days.
Calculating the Weekday
Now for the fun part. Given any date after 1582, we can calculate what day of the week it falls on using pure arithmetic.
The method I’ll show you comes from David M. Burton’s book “Elementary Number Theory.” It’s elegant and relies on modular arithmetic.
The Setup
We need to establish some conventions.
First, we number the days of the week:
0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
Second, we renumber the months. This is the weird part. Because leap day falls at the end of February, it’s mathematically convenient to treat March as the first month of the year and February as the last. So:
1 = March
2 = April
3 = May
4 = June
5 = July
6 = August
7 = September
8 = October
9 = November
10 = December
11 = January
12 = February
This means January and February “belong” to the previous year in our calculation. If you’re finding the weekday for January 15, 2024, you treat it as month 11 of year 2023.
Third, we split the year into century and year-within-century. For year \( Y \), we write \( Y = 100c + y \), where \( c \) is the century and \( y \) is the remaining two digits. For 2024, we have \( c = 20 \) and \( y = 24 \).
The Formula
The weekday number \( w \) is given by:
$$w \equiv d + \lfloor 2.6m – 0.2 \rfloor – 2c + y + \lfloor c/4 \rfloor + \lfloor y/4 \rfloor \pmod{7}$$
Where:
- \( d \) is the day of the month
- \( m \) is the month number (using our March = 1 system)
- \( c \) is the century
- \( y \) is the year within the century
- \( \lfloor x \rfloor \) means the floor function (round down to the nearest integer)
- \( \pmod{7} \) means we take the remainder when dividing by 7
The formula looks intimidating. It’s not. Let me walk through why each piece is there.
Why It Works
A common year has 365 days. Since \( 365 = 52 \times 7 + 1 \), a common year has 52 complete weeks plus 1 extra day. So if January 1 is a Monday, then the next January 1 is a Tuesday. The weekday advances by 1 each year.
A leap year has 366 days = 52 weeks + 2 days. So weekdays advance by 2 after a leap year.
The \( y + \lfloor y/4 \rfloor \) part counts years plus leap years within the century.
The \( -2c + \lfloor c/4 \rfloor \) part handles the century adjustment. Remember that century years are only leap years if divisible by 400. This correction accounts for the skipped leap years at 1700, 1800, 1900, 2100, etc.
The \( \lfloor 2.6m – 0.2 \rfloor \) part handles the varying lengths of months. Months have 28, 29, 30, or 31 days. This term encodes the cumulative shift caused by months of different lengths. The 2.6 factor comes from the average “extra days” per month beyond 28, and the -0.2 adjusts the offset.
The \( d \) is just the day of the month.
Add them all up, take the remainder when dividing by 7, and you get the weekday.
Worked Examples
Let me show you how this works in practice.
Example 1: December 9, 2011
First, identify the variables:
- \( d = 9 \)
- \( m = 10 \) (December is month 10 in our system)
- \( Y = 2011 = 100 \times 20 + 11 \), so \( c = 20 \) and \( y = 11 \)
Plug into the formula:
$$w \equiv 9 + \lfloor 2.6 \times 10 – 0.2 \rfloor – 2(20) + 11 + \lfloor 20/4 \rfloor + \lfloor 11/4 \rfloor \pmod{7}$$
Calculate each piece:
- \( \lfloor 2.6 \times 10 – 0.2 \rfloor = \lfloor 25.8 \rfloor = 25 \)
- \( -2(20) = -40 \)
- \( \lfloor 20/4 \rfloor = 5 \)
- \( \lfloor 11/4 \rfloor = 2 \)
Sum: \( 9 + 25 – 40 + 11 + 5 + 2 = 12 \)
Now take mod 7: \( 12 \mod 7 = 5 \)
Weekday 5 = Friday. December 9, 2011 was a Friday.
Example 2: July 4, 1776 (American Independence Day)
Variables:
- \( d = 4 \)
- \( m = 5 \) (July is month 5)
- \( Y = 1776 = 100 \times 17 + 76 \), so \( c = 17 \) and \( y = 76 \)
Calculate:
$$w \equiv 4 + \lfloor 2.6 \times 5 – 0.2 \rfloor – 2(17) + 76 + \lfloor 17/4 \rfloor + \lfloor 76/4 \rfloor \pmod{7}$$
- \( \lfloor 2.6 \times 5 – 0.2 \rfloor = \lfloor 12.8 \rfloor = 12 \)
- \( -2(17) = -34 \)
- \( \lfloor 17/4 \rfloor = 4 \)
- \( \lfloor 76/4 \rfloor = 19 \)
Sum: \( 4 + 12 – 34 + 76 + 4 + 19 = 81 \)
Take mod 7: \( 81 \mod 7 = 4 \) (since \( 81 = 11 \times 7 + 4 \))
Weekday 4 = Thursday. The Declaration of Independence was signed on a Thursday.
Example 3: August 15, 1947 (Indian Independence Day)
Variables:
- \( d = 15 \)
- \( m = 6 \) (August is month 6)
- \( Y = 1947 = 100 \times 19 + 47 \), so \( c = 19 \) and \( y = 47 \)
Calculate:
$$w \equiv 15 + \lfloor 2.6 \times 6 – 0.2 \rfloor – 2(19) + 47 + \lfloor 19/4 \rfloor + \lfloor 47/4 \rfloor \pmod{7}$$
- \( \lfloor 2.6 \times 6 – 0.2 \rfloor = \lfloor 15.4 \rfloor = 15 \)
- \( -2(19) = -38 \)
- \( \lfloor 19/4 \rfloor = 4 \)
- \( \lfloor 47/4 \rfloor = 11 \)
Sum: \( 15 + 15 – 38 + 47 + 4 + 11 = 54 \)
Take mod 7: \( 54 \mod 7 = 5 \) (since \( 54 = 7 \times 7 + 5 \))
Weekday 5 = Friday. India gained independence on a Friday.
Example 4: January 15, 2024
This one requires the year adjustment since January is month 11 in our system.
Variables:
- \( d = 15 \)
- \( m = 11 \) (January is month 11)
- Since January “belongs” to the previous year, use \( Y = 2023 = 100 \times 20 + 23 \), so \( c = 20 \) and \( y = 23 \)
Calculate:
$$w \equiv 15 + \lfloor 2.6 \times 11 – 0.2 \rfloor – 2(20) + 23 + \lfloor 20/4 \rfloor + \lfloor 23/4 \rfloor \pmod{7}$$
- \( \lfloor 2.6 \times 11 – 0.2 \rfloor = \lfloor 28.4 \rfloor = 28 \)
- \( -2(20) = -40 \)
- \( \lfloor 20/4 \rfloor = 5 \)
- \( \lfloor 23/4 \rfloor = 5 \)
Sum: \( 15 + 28 – 40 + 23 + 5 + 5 = 36 \)
Take mod 7: \( 36 \mod 7 = 1 \)
Weekday 1 = Monday. January 15, 2024 was a Monday (Martin Luther King Jr. Day that year).
Practice Problems
Try these yourself before checking the answers:
- October 19, 1992
- March 21, 1688
- June 8, 2333
- December 25, 2000
- Your own birthday
Answers
October 19, 1992: \( m = 8 \), \( d = 19 \), \( c = 19 \), \( y = 92 \). Sum = 120. \( 120 \mod 7 = 1 \). Monday.
March 21, 1688: \( m = 1 \), \( d = 21 \), \( c = 16 \), \( y = 88 \). Sum = 98. \( 98 \mod 7 = 0 \). Sunday.
June 8, 2333: \( m = 4 \), \( d = 8 \), \( c = 23 \), \( y = 33 \). Sum = 39. \( 39 \mod 7 = 4 \). Thursday.
December 25, 2000: \( m = 10 \), \( d = 25 \), \( c = 20 \), \( y = 0 \). Sum = 21. \( 21 \mod 7 = 0 \). Sunday. (Christmas 2000 fell on Sunday.)
A Quick Note on Modular Arithmetic
If you haven’t seen modular arithmetic before, here’s the quick version.
When we write \( a \equiv b \pmod{n} \), we mean that \( a \) and \( b \) have the same remainder when divided by \( n \). Equivalently, \( n \) divides \( a – b \).
So \( 15 \equiv 1 \pmod{7} \) because 15 divided by 7 gives remainder 1. And \( 365 \equiv 1 \pmod{7} \) because 365 divided by 7 gives remainder 1 (that’s why weekdays advance by 1 each year).
Modular arithmetic is sometimes called “clock arithmetic” because it wraps around. On a 12-hour clock, 10 + 5 = 3 (in mod 12). On our weekday system, day 8 is the same as day 1 (in mod 7).
This is the foundation of modern cryptography, by the way. RSA encryption is built on modular arithmetic with very large prime numbers.
Other Methods
The formula I showed you isn’t the only way to calculate weekdays. There are several others.
Zeller’s Congruence is probably the most famous. It’s similar to our formula but uses a slightly different month-numbering scheme. Many programming implementations use Zeller’s version.
The Doomsday Algorithm, invented by mathematician John Conway, is designed for mental calculation. You memorize certain “anchor dates” that always fall on the same weekday in any given year, then count from there. With practice, you can calculate weekdays in your head in seconds.
Lewis Carroll’s method (yes, the Alice in Wonderland author was also a mathematician) involves memorizing century codes and month codes, then adding them up. It’s less elegant but easier to do without pencil and paper.
All these methods work because the Gregorian Calendar is deterministic. Given the rules, you can calculate any date’s weekday from first principles.
Limitations
The formula only works for dates after the Gregorian Calendar was adopted. For dates before October 15, 1582, you’d need to use a Julian Calendar formula (which is simpler since all century years are leap years).
But even that’s complicated by the fact that different countries adopted the Gregorian Calendar at different times. A date in 1700 in England was on the Julian Calendar, while the same date in Spain was Gregorian. They were 10 days apart.
If you’re doing historical research, you need to know which calendar was in use in that place at that time. This trips up even professional historians sometimes.
Why This Matters
You probably won’t need to calculate weekdays by hand very often. Your phone can do it instantly.
But understanding the formula teaches you something deeper. It shows how a messy real-world problem (tracking days and seasons) can be tamed by mathematics. The calendar is an algorithm, and algorithms can be analyzed, understood, and computed.
It also reveals the hidden complexity in something we take for granted. The Gregorian Calendar is a brilliant piece of engineering. A 400-year cycle that stays accurate for millennia. It’s one of humanity’s better inventions, even if it took us 340 years to agree on it.
Frequently Asked Questions
Why do we have leap years?
Earth takes approximately 365.2422 days to orbit the Sun. A 365-day calendar loses about a quarter day each year. After four years, you’re a full day behind the seasons. Leap years add an extra day to compensate for this drift, keeping the calendar aligned with astronomical events like equinoxes and solstices.
Why aren’t all century years leap years?
The Julian Calendar made every fourth year a leap year, giving an average of 365.25 days per year. But Earth’s orbit is actually 365.2422 days. The 0.0078 day difference accumulated over centuries. The Gregorian reform skips leap years on century years unless divisible by 400, giving an average of 365.2425 days, much closer to reality.
What happened to the 10 missing days in 1582?
Pope Gregory XIII decreed that Thursday, October 4, 1582 would be followed immediately by Friday, October 15, 1582. Ten days were simply skipped to realign the calendar with the spring equinox. Nobody “lost” any time. The days just weren’t counted. People went to bed on the 4th and woke up on the 15th.
Why did Britain wait until 1752 to adopt the Gregorian Calendar?
Protestant countries refused to adopt a reform from the Catholic Pope. Religious tensions trumped practical calendar concerns. Britain held out for 170 years and had to skip 11 days instead of 10 when they finally adopted it. The delay caused confusion in international trade and correspondence for nearly two centuries.
Why does the formula treat March as the first month?
Leap day is added to February. By treating March as month 1 and February as month 12, the leap day falls at the end of the year in our calculation. This simplifies the math because the “extra” day doesn’t disrupt the month-length pattern for the rest of the year.
What is modular arithmetic?
Modular arithmetic deals with remainders after division. When we write a ≡ b (mod n), we mean a and b have the same remainder when divided by n. For weekday calculations, we use mod 7 because there are 7 days in a week. Day 8 wraps around to day 1. It’s like clock arithmetic.
Does this formula work for dates before 1582?
No. Before October 15, 1582, you need to use the Julian Calendar formula instead (which is simpler since all century years are leap years). And different countries adopted the Gregorian Calendar at different times, so a date in 1700 might be Julian in England but Gregorian in Spain.
What is the Doomsday Algorithm?
The Doomsday Algorithm, invented by mathematician John Conway, is a mental calculation method. You memorize that certain dates (4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February) always fall on the same weekday in any given year. You figure out that anchor day, then count from the nearest one to your target date.
Why does George Washington have two birthdays?
Washington was born February 11, 1731 under the Julian Calendar. When Britain adopted the Gregorian Calendar in 1752, they skipped 11 days and moved New Year’s Day from March 25 to January 1. His birthday shifted to February 22, 1732 in the new system. Both dates refer to the same actual day.
How accurate is the Gregorian Calendar?
Very accurate. The Gregorian Calendar averages 365.2425 days per year, compared to Earth’s actual orbital period of 365.2422 days. The error is only 0.0003 days per year, meaning the calendar drifts by one day every 3,236 years. We won’t need another calendar reform until around the year 4818.