UnityLife

Calendar-anchor algorithm

Date duration calculator

Years, months and days between two dates — plus total weeks, calendar months and hours. Handles leap years and variable month lengths the way humans expect.

Free tool

Duration

--

Years, months and days are computed using the calendar-anchor algorithm (the same one used in our Age Calculator) so leap years and variable month lengths produce stable, intuitive results — e.g. Feb 29 to Feb 28 next year is 0 y 11 mo 30 d in non-leap years and exactly 1 y in a leap-year crossover.

Why two answers

Asking “how long between Feb 29 2020 and Feb 28 2024” has two legitimate answers depending on what you mean. By calendar: 3 years, 11 months, 30 days. By raw days: 1,460 days. By weeks: 208.6. By calendar months counted from boundary to boundary: 47. All correct, all answer different questions.

Calendar-anchor (years, months, days)

The years/months/days breakdown is calendar-anchored: it borrows days from the previous month and months from the year exactly the way most date-arithmetic libraries do (Java’sPeriod.between, Python’s dateutil, spreadsheet DATEDIF). It produces the intuitive answer most people expect for anniversaries, contract terms, ages and tenure calculations.

Total days (the canonical count)

Total days is the unambiguous count and the right number to use for billing, interest accrual, simple-day arithmetic, and the “you have been alive for X days” novelty. Because it doesn’t depend on calendar boundaries, it’s the field to subtract / add when comparing durations.

Common uses

  • Anniversaries (relationships, hire dates, sobriety, quitting smoking).
  • Contract or warranty term calculations.
  • Visa / immigration day counts (Canadian PR residency obligation: 730 days in 5 years).
  • Age verification (“were they 18 on this date”).
  • Deliberate-practice tracking (“weeks since I started”).

This tool is for educational purposes only and does not provide medical advice, diagnosis, or treatment. Always consult a licensed Canadian healthcare professional. Read our full disclaimer.