Date To Date Calculator
Calculate the exact duration between two dates in years, months, days, weeks, hours, and business days with precision.
Select two dates and click Calculate
About
Calculating the interval between two dates manually invites errors that compound in contracts, project timelines, and financial instruments. A miscounted month can shift a payment deadline; a forgotten leap day invalidates an entire schedule. This calculator computes the exact duration using iterative month-stepping rather than the flawed 30.44-day average, correctly handling February's variable length and year boundaries. It returns Y years, M months, D days alongside total days, weeks, business days (excluding weekends), and granular breakdowns to hours and minutes. ISO 8601 week numbers for both dates are included for sprint planning and fiscal reporting.
The business day calculation excludes Saturdays and Sundays but not public holidays, which vary by jurisdiction. For legal documents or SLA calculations, verify against your local holiday calendar. The algorithm assumes the Gregorian calendar; dates before October 15, 1582 will produce mathematically correct but historically anachronistic results.
Formulas
The primary calculation uses iterative month-stepping to accurately handle variable month lengths:
where t represents the Unix timestamp in milliseconds. For the calendar breakdown:
Leap year detection follows the Gregorian rule:
ISO 8601 week number calculation:
where ordinalDay is the day of the year (1 - 366) and weekday uses Monday = 1 through Sunday = 7.
Reference Data
| Time Unit | Equivalent | Notes |
|---|---|---|
| 1 minute | 60 seconds | SI base conversion |
| 1 hour | 60 minutes | 3,600 seconds |
| 1 day | 24 hours | 86,400 seconds |
| 1 week | 7 days | 168 hours |
| 1 fortnight | 14 days | Common in UK payroll |
| 1 month (avg) | 30.437 days | Gregorian average; actual 28 - 31 |
| 1 quarter | 3 months | ~91 days; fiscal reporting |
| 1 year (common) | 365 days | 8,760 hours |
| 1 year (leap) | 366 days | Divisible by 4, exceptions apply |
| 1 decade | 10 years | ~3,652 days |
| 1 century | 100 years | 24 leap years typically |
| ISO Week | 1 - 53 | Starts Monday; Week 1 contains Jan 4 |
| Julian Day Number | Continuous count | Day 0 = Jan 1, 4713 BC |
| Unix Epoch | Jan 1, 1970 00:00 UTC | Seconds since epoch |
| Business Days/Year | ~252 | US average; excludes weekends + ~10 holidays |
| Work Hours/Year | ~2,080 | 52 weeks ร 40 hrs |
| Days in February | 28 or 29 | Leap year rule determines |
| Leap Year Rule | Divisible by 4 | Except centuries not divisible by 400 |
| Gregorian Adoption | Oct 15, 1582 | 10 days skipped from Julian |