Date Difference Calculator
Calculate the number of days, weeks, months and years between two dates.
Last updated · View algorithm, constants and default inputs (JSON)
Results
About this calculator
Dates are sorted from earlier to later. Choose which endpoints count; weekday totals use exactly those dates and exclude only Saturday and Sunday, not holidays.
Worked example
calculated with the default values below
Start date 2025-10-31 · End date 2026-10-31 · Include the end day No · Dates included in the count Use the existing endpoint selector Days 365 days · Weeks 52.14 weeks · Months 12.00 months · Years 0.999 years · Weekdays (Mon–Fri) 261 days · Hours 8,760 h · Calendar years in the breakdown 1 · Remaining calendar months 0 · Remaining calendar days 0 · Total minutes in counted dates 525,600 min
Method and assumptions
Dates are sorted from earlier to later. Choose which endpoints count; weekday totals use exactly those dates and exclude only Saturday and Sunday, not holidays. Calendar years, months and remaining days use month-end clamping and do not change with endpoint counting. Fractional years use 365.2425 days. The older time-between entry keeps its calendar years/months/days fields, while totalDays is the counted span.
General background references
Disclaimer
These calculators give general date results. Public holidays, working-day conventions and time-zone rules are set locally and change, so confirm against the official calendar for anything legally or contractually binding.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
elapsed = |E − S|/86400000; counted = elapsed + (both endpoints ? 1 : 0); hours = 24 × counted; calendar months use clamped month shifts
Fractional years use 365.2425 days. The older time-between entry keeps its calendar years/months/days fields, while totalDays is the counted span.
Frequently asked questions
What does including the end day change?
Dates are sorted from earlier to later. Choose which endpoints count; weekday totals use exactly those dates and exclude only Saturday and Sunday, not holidays. Calendar years, months and remaining days use month-end clamping and do not change with endpoint counting. Fractional years use 365.2425 days. The older time-between entry keeps its calendar years/months/days fields, while totalDays is the counted span.