Date Difference Calculator
Difference between two dates in every common unit.
Overview
The Date Difference Calculator measures the gap between two dates and reports it in every common unit at once: total years, months, weeks, days, hours, minutes, and seconds, plus a "Y years M months D days" breakdown that matches how people naturally describe the span. Enter a start and end date and the full picture appears in a single panel.
Useful for HR teams calculating tenure, contract lawyers measuring notice periods, anniversary planners, historians dating events, and developers building reports that need both a friendly "3 years, 2 months" label and a precise day count for sorting or invoicing.
How it works
The breakdown follows ISO 8601 duration semantics: years are walked first by checking anniversary boundaries, then months are walked by anniversary, and the remaining days are computed against the actual length of the last full month. The total-days, total-hours, and total-seconds figures are taken directly from the difference in ticks between the two timestamps to avoid the variable length of months interfering.
Weeks are rendered as total_days ÷ 7 rounded, while the breakdown line carries calendar-accurate year and month components, so a 365- or 366-day gap correctly reads as "1 year" in the breakdown even though the total-days figure differs by one.
Examples
2020-01-01 → 2026-05-18
Total: 2,329 days, 332 weeks
Breakdown: 6 years, 4 months, 17 days
2024-02-29 → 2025-02-28
Total: 365 days
Breakdown: 0 years, 11 months, 30 days
2026-01-01 00:00 → 2026-01-02 06:30
Total: 30 hours 30 minutes
FAQ
Why does the breakdown sometimes say "11 months 30 days" instead of "1 year"?
A calendar anniversary has not yet been crossed. Feb 29 to Feb 28 the next year is one day short of the anniversary so the breakdown reports it accurately rather than rounding up.
How are leap years counted in the total-days figure?
The total uses raw 24-hour days, so a span that crosses a leap year is one day longer than one that does not — useful for accurate interest and rent calculations.
Does it handle BC dates?
The .NET DateTime range starts at year 1, so historic dates earlier than that are out of scope. Use the Julian date converter for astronomical work.
Is the result inclusive or exclusive of the end date?
Differences are computed as end − start, so the end date itself is not counted as a full day. Add one if you need an inclusive count.
What if I swap start and end?
The result is shown as a negative duration with the same magnitude, useful for spotting accidentally reversed inputs.