Date to Date Calculator

Calculate the duration between two dates.

Time & Date Auto swap Business days
Rate this calculator · 5.0 (1)

Date to date duration

Y/M/D · total days · business days

Instructions — Date to Date Calculator

1

Enter the two dates

From date and To date can be in any order. If you enter them backward, the calculator swaps them automatically and notes the swap in the formula line. Both dates are interpreted in your browser’s local timezone.

2

Choose end-date inclusion

"No" (default) excludes the end date itself: Jan 1 to Jan 8 returns 7 days. "Yes" includes the end date: same range returns 8 days. Most legal and HR contexts use the exclusive (default) convention.

3

Read the breakdown

The headline shows years, months, and remaining days. The grid below adds total days, weeks, months (decimal), years (decimal), business days (Mon–Fri), and weekend days.

Leap years handled automatically: the calculator counts Feb 29 in years divisible by 4 (and skips it in years divisible by 100 unless also divisible by 400). 1900 was not a leap year; 2000 was.
Quick presets: the buttons set the From date to N years before the current To date. Useful for anniversaries, statute-of-limitations checks, or aging calculations.

Formulas

Date arithmetic is mostly straightforward subtraction once you switch to a uniform numeric basis. Calendar quirks (months with different lengths, leap years) live entirely in the breakdown logic, not in the total-days math.

Total days between two dates
$$ d = \frac{t_2 - t_1}{86400} $$
Convert both dates to seconds since the Unix epoch (1970-01-01), subtract, divide by 86,400 (seconds per day). Leap years and month lengths are baked in.
Calendar Y/M/D breakdown
$$ y = Y_2 - Y_1, \; m = M_2 - M_1, \; d = D_2 - D_1 $$
Subtract field by field, then borrow when negative. If days go negative, subtract one month and add the prior month’s day count. If months go negative, subtract one year and add 12.
Decimal months and years
$$ \text{mo} = \frac{d}{30.4375}, \; \text{yr} = \frac{d}{365.25} $$
Average month is 30.4375 days (365.25 / 12). Average year is 365.25 days, accounting for one leap day every 4 years.
Leap year rule (Gregorian)
$$ \text{leap} = (y \% 4 = 0) \;\&\; (y \% 100 \neq 0 \;\|\; y \% 400 = 0) $$
Year divisible by 4 = leap, except divisible by 100 = not leap, except divisible by 400 = leap. 1900: not. 2000: yes. 2100: not.
Business days (Mon-Fri)
$$ b \approx d \times \frac{5}{7} - h $$
Where h is holidays. The 5/7 ratio is exact only for full weeks; partial weeks shift the count by 1 or 2 depending on which weekday the range starts. The calculator iterates day by day for precision.
Worked example
$$ \text{Jan 1, 2024} \rightarrow \text{Jan 1, 2026} = 731 \text{ days} $$
Two years apart, one leap year (2024) in between, gives 366 + 365 = 731 days. Decimal years: 731 / 365.25 = 2.001. The 0.001 reflects the extra leap day.

Reference

Common date durations
DurationDaysNotes
1 week7fixed
1 month (Feb)28 or 29leap-year dependent
1 month (avg)30.44365.25 / 12
1 quarter~91.33 months average
Half year~182.6
1 year365 or 366leap-year dependent
Decade3,652 or 3,653typically 2–3 leap years
Century36,524 or 36,525century rule depends on /400
Statute of limitations (US tort)~730 (2 yr)state-dependent

Calendar quirks to know

Edge cases that catch first-time date-arithmetic users.

Leap years 2020–2040
YearLeap?
2020Yes
2024Yes
2028Yes
2032Yes
2036Yes
2040Yes
Calendar history
EventDate
Julian calendar starts45 BCE
Gregorian reform (Catholic)1582
UK adopts Gregorian1752
Russia adopts Gregorian1918
Unix epoch begins1970-01-01

Note: this calculator uses the Gregorian calendar throughout, even for dates before the local Gregorian adoption. For historical research, dates before 1582 may need conversion to Julian. Library catalogs and government archives often use the Old Style (Julian) date in parentheses.

Article — Date to Date Calculator

Date to date calculator: days, weeks, months, years between

A date to date calculator returns the duration between any two dates as a calendar breakdown (years, months, days) plus total days, weeks, decimal months, and business days. Jan 1 to Jan 8 returns 7 days under the standard exclusive convention; toggling include-end-date makes it 8. The calculator handles leap years automatically and auto-swaps the inputs if you enter them backward.

Date arithmetic looks easy until it isn't. Months have different lengths. Leap years insert an extra day every four years (mostly). Business-day counts depend on which weekdays fall in the range. The calculator handles all of these; the explanations below cover the assumptions and edge cases so you can read the result with confidence.

What this date to date calculator does

It computes elapsed time between two dates and breaks the result into six common units: a calendar Y/M/D breakdown, total days, weeks, decimal months, decimal years, and business days. Each is useful for different scenarios.

  • Calendar Y/M/D: "2 years, 3 months, 14 days" — how humans describe duration
  • Total days: precise daily count, ignores month boundaries
  • Total weeks: useful for pregnancy, project tracking, contract terms
  • Decimal months: averages out month-length variance; good for interest calculation
  • Decimal years: standard for actuarial and aging calculations
  • Business days: Mon-Fri only, used for legal deadlines and shipping windows

How to count days between dates

The standard convention excludes the end date. From Monday to Friday is 4 days, not 5. From Jan 1 to Jan 8 is 7 days, exactly one week. This matches how almost every legal contract, payroll system, and academic syllabus counts.

Days between dates
days = (to - from) in calendar days swap if to is earlier

If you need the inclusive count (Monday through Friday = 5 days, the way you would count "I worked 5 days this week"), use the include-end-date toggle. The result is one higher across every duration metric: 8 days instead of 7, 1.05 weeks instead of 1.00 weeks.

Calendar months and years

Months and years cannot be expressed as a fixed day count because they aren't fixed. The calculator returns two values: a calendar breakdown (whole years and months plus remaining days) and a decimal value using average month and year lengths.

The calendar breakdown is what humans want when they ask "how old is my child?" — a 14-month-old is "1 year and 2 months," not "1.17 years." The decimal value is what spreadsheets want for interest calculations and statistical analysis. The two values describe the same duration but emphasize different aspects.

Did you know

The decimal month figure uses 30.4375 days per month, which is 365.25 divided by 12. The standard Gregorian average year is 365.2425 days, so the calculator's 365.25 is a rounding shortcut. The error accumulates to one day over about 133 years. For any human-scale calculation, the difference is irrelevant; for long historical research, it matters.

Business days vs. calendar days

Business days skip Saturday and Sunday. The relationship is roughly 5 business days per 7 calendar days, but the exact ratio depends on which weekday the range starts and ends on. A 30-calendar-day range that begins on a Monday will contain 22 business days; the same 30 calendar days beginning on a Friday will contain 21.

30 calendar days
~22 business
depends on start day
90 calendar days
~64 business
approx 9/13 ratio

The calculator iterates day by day to count weekdays accurately. It does not subtract public holidays, which vary by country, state, and even employer. For legal-deadline math, add a buffer of 1 to 3 days to allow for federal holidays in your jurisdiction.

Leap years and date math

The Gregorian leap-year rule: a year is a leap year if divisible by 4, except if divisible by 100, except if divisible by 400. So 2000 was a leap year (divisible by 400); 1900 was not (divisible by 100 but not 400); 2024 is (divisible by 4).

The rule keeps the calendar aligned with the solar year. Without leap days, the calendar would drift forward by about one day every four years. Within 1,000 years, dates would no longer match the seasons; spring would arrive in February. The Julian calendar (45 BCE) used a leap year every 4 years uniformly; Pope Gregory XIII's 1582 reform added the century-rule exception to fix a 10-day drift that the Julian calendar had accumulated since the Council of Nicaea (about 1,257 years earlier).

Tip

For age calculations spanning Feb 29 birthdays, JavaScript handles the edge case correctly: someone born Feb 29, 2000 turns 1 year old on Mar 1, 2001 in non-leap years, and on Feb 29, 2004 in the next leap year. The calculator follows the same convention. Some legal systems explicitly rule on this ("a person born Feb 29 attains age N on Feb 28 in non-leap years"); the calculator's result is the mathematical, not legal, age.

Include end date or not?

The default is exclusive: Jan 1 to Jan 8 returns 7 days. This matches contract language ("delivery within 30 days of order"), payroll periods, and statistical analysis.

The inclusive option adds 1 day: Jan 1 to Jan 8 returns 8 days. This matches how people count attendance ("we were there 8 days, from Sunday to Sunday") and some statute-of-limitations conventions. Same dates, different conventions; the math is identical except for the +1.

Dates before 1582 and historical quirks

The calculator uses the Gregorian calendar throughout, even for dates before 1582. That gives the right answer for almost every modern use case. For historical research, the picture is more complex.

The Catholic countries adopted the Gregorian calendar in 1582. The UK and its colonies (including what was then the British North American colonies) waited until 1752 — when 11 days were skipped to realign the calendar. Russia waited until 1918. Greece converted last among European states in 1923. Historical records before each country's adoption use the Julian calendar; converting them requires knowing both the source country and the date.

Common date calculation mistakes

Confusing inclusive and exclusive counting. The difference is one day, which matters for legal deadlines, payroll periods, and lease terms. Always check which convention applies before submitting a contract.

Approximating months as 30 days. Most months are 30 or 31. February is 28 or 29. Over a year, the 30-day approximation accumulates 5 to 6 days of error. The calculator's decimal-months figure uses 30.4375 days to avoid this drift.

Ignoring time zones. The calculator works in your browser's local timezone. A date entered as 2026-01-01 means midnight on Jan 1 in your time zone. For international scheduling, the same calendar date can refer to different actual moments — a contract "effective Jan 1, 2026" means different things in New York and Tokyo.

Legal deadlines are not always calendar math

Statute-of-limitations and contract-deadline rules vary by jurisdiction. Some count from the day after the triggering event; some include weekends and holidays, some don't; some roll to the next business day if the deadline lands on a Sunday. This calculator gives the calendar arithmetic. The legal interpretation is a question for your jurisdiction's rules and, when in doubt, an attorney.

FAQ

The calculator subtracts the From date from the To date and returns the total. The standard convention excludes the end date: Jan 1 to Jan 8 = 7 days, not 8. Toggle "Include end date" if you want the inclusive count. Leap years are handled automatically.
Two ways. The calendar breakdown counts whole years and months between the dates, with remaining days. The decimal-months figure uses the average month length (30.4375 days). Apr 1 to Jun 1 returns 2 months in the calendar breakdown and 2.0 in decimal months. Mismatched day-of-month values produce a fractional remainder.
Yes. Years divisible by 4 are leap years (with the exceptions for years divisible by 100 but not 400). Feb 29 is counted in those years. 2000, 2004, 2008,..., 2024, 2028 are all leap years. 1900 was not (divisible by 100 but not 400).
Calendar days include every day of the week. Business days count only Monday through Friday. 30 calendar days is about 21 business days; 90 calendar days is about 64 business days. The calculator does not subtract public holidays — for legal-deadline use cases, adjust manually for federal or state holidays in your range.
The calculator auto-swaps them. The "swapped" note appears in the formula line so you know which direction was used. The result is always positive. If you need a signed difference (negative for past dates), subtract manually.
Use the From date as the birth date and the To date as the current or reference date. The calendar breakdown returns the standard age format: years, months, days. For US legal age, only the years matter; some jurisdictions use whole-years-completed, not nearest-year, so age 17 on the 17th-birthday minus one day.
The Earth orbits the Sun in 365.2422 days. The Gregorian calendar uses 365.2425 days on average (one leap day every 4 years, minus three leap days every 400 years). The 0.0003 mismatch will accumulate to one day error over about 3,300 years — not a problem today.
The calculator uses the Gregorian calendar throughout. Before 1582 (Catholic) or later in some countries, the Julian calendar applied. For dates before 1752 in the UK and US, or before 1918 in Russia, you may need a Julian-to-Gregorian conversion. The math still works; the day-count interpretation depends on which calendar applies to the source.