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 = (to - from) in calendar days swap if to is earlierIf 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.
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.
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).
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.
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.