How many days until the wedding? What date is 90 days from today? Was July 4, 1776 really a Thursday? Date arithmetic underpins deadlines, contracts, project plans, and countless everyday questions—yet doing it by hand is notoriously error-prone. Months have 28 to 31 days, leap years add a day, and 'business days' skip weekends and holidays. Here's how date math actually works.
Counting Days Between Two Dates
The cleanest way to count days between dates is to convert each date to a serial day number—a running count of days from a fixed starting point—and subtract. This is exactly how spreadsheets work: Excel counts days from January 1, 1900, so any date subtraction becomes simple integer arithmetic. Programmers use Unix time (seconds since January 1, 1970) or Julian day numbers the same way.
One critical subtlety: inclusive versus exclusive counting. From Monday to Friday is 4 days if you count the gap (exclusive), but 5 days if you count both endpoints (inclusive). Contracts, rental periods, and medication schedules often differ on this convention, so always check which one applies. A day counter typically shows both so there's no ambiguity.
Adding and Subtracting Time Periods
Adding days to a date is unambiguous—30 days after March 15 is April 14, full stop. Adding months is trickier because months vary in length. What is one month after January 31? Most conventions say February 28 (or 29 in a leap year), clamping to the last valid day of the target month. This 'end-of-month clamping' is why adding one month and then subtracting one month doesn't always return you to the starting date.
- Adding days: exact and reversible—the workhorse of deadline math.
- Adding weeks: just days × 7, equally exact.
- Adding months: clamps to month-end when the target day doesn't exist (Jan 31 + 1 month = Feb 28/29).
- Adding years: only ambiguous for February 29 birthdays, which clamp to February 28 in common years.
Business Days: Skipping Weekends and Holidays
Many real-world deadlines—court filings, bank transfers, shipping estimates—are expressed in business days, which exclude Saturdays, Sundays, and public holidays. Converting between calendar days and business days isn't a fixed ratio: 10 business days is exactly 14 calendar days only if no holidays intervene. A span containing Thanksgiving week or the Christmas–New Year stretch can add several extra calendar days.
As a rule of thumb, multiply business days by 1.4 to estimate calendar days, then adjust for holidays. For anything with legal or financial consequences, count explicitly with a date calculator rather than estimating—being one day late on a filing deadline can be costly.
Finding the Day of the Week for Any Date
Determining the weekday of an arbitrary date is a classic mental-math feat, and the underlying algorithm is elegant. Zeller's congruence and the 'Doomsday rule' (devised by mathematician John Conway) both exploit the fact that certain easy-to-remember dates—4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February—always fall on the same weekday within any given year. Find that year's 'doomsday', then step to your target date.
For example, the doomsday for 2026 is Saturday. July 11 (7/11, another doomsday date) is therefore a Saturday, which means July 31, 2026—twenty days later—falls on a Friday. A Day of the Week Calculator applies this logic instantly for any date, past or future, and correctly handles the Gregorian calendar switch and century rules.
Common Date Math Pitfalls
- Off-by-one errors: forgetting whether the count is inclusive or exclusive of the endpoints.
- Assuming all months have 30 days: 'net 30' payment terms are 30 actual days, not 'one month'.
- Ignoring leap years in long spans: a 10-year interval contains 2 or 3 leap days.
- Time zone boundaries: an event at 11 PM in New York is already 'tomorrow' in London—date differences can shift by a day depending on the zone.
- The missing days of 1582: when the Gregorian calendar was adopted, October 5–14, 1582 simply never existed in Catholic countries (Britain skipped 11 days in 1752).
Date math is deterministic but full of traps for manual calculation. Whether you're counting down to an event, computing a contract deadline, or settling a trivia debate about a historical weekday, a Date Calculator does the serial-number arithmetic for you and gets the leap years, month lengths, and conventions right every time.
