Duration Between Two Dates (Years / Months / Days / Hours)

How long is it between two dates? Calendar arithmetic is fiddly because months have different lengths and years can be leap. This calculator gives you the duration in every unit — years + months + days + hours + minutes + seconds — plus a single-unit answer ("4327 days", "103848 hours").

How to use the Duration Between Two Dates (Years / Months / Days / Hours)

Pick two dates / times. The "decomposed" duration shows years + months + days + … like a human would describe it ("3 years, 4 months, 12 days"). The "single unit" table converts the total duration into each unit.

Why date subtraction is harder than it looks

Subtracting two dates is not like subtracting two numbers. Months run from 28 to 31 days, years can be leap, and "one month after January 31" is genuinely ambiguous. That is why this calculator gives two answers: a decomposed duration that reads the way a person would say it ("3 years, 4 months, 12 days"), and a single-unit total in each unit (so many days, so many hours, and so on).

The decomposed form is what you want for ages and anniversaries; the single-unit totals are what you want for billing, SLAs, or any calculation where "how many days exactly" matters more than the calendar breakdown.

Common use cases

  • Age calculation — get an exact "years, months, days" between a birth date and today.
  • Anniversaries and milestones — express how long between two events in human terms.
  • Billing and tenure — total the days or hours between a start and end date for invoicing or length of service.
  • Project timelines — measure the span between a kickoff and a deadline.
  • Historical spans — find the distance between two dates in whichever unit you need.

Frequently asked questions

How is "X months" calculated when months differ in length?

It counts whole calendar months first, then the leftover days. Going from January 31 to March 1 is treated as one month and a day or two, not a fixed 30-day step, which keeps the human-readable form honest.

Does it account for leap years?

Yes. February 29 is handled correctly, so a span crossing one or more leap years gets the right day totals.

How is this different from the time-difference tool?

This one is human-oriented: date pickers in, calendar units out. The time-difference tool parses ISO 8601 and Unix timestamps and emits an ISO 8601 duration string, which suits logs and code.

Is the duration inclusive of both endpoints?

It measures the elapsed interval from the start instant to the end instant — effectively end minus start. If you need to count both dates as full days (an inclusive day count), add one to the day total.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: