UnityLife

Calendar-anchor algorithm

Age difference calculator

Years, months and days between two birth dates. Plus total days and weeks apart. Useful for siblings, partners, twins or cousins.

Free tool

Person A is older

2 y 2 mo 20 d

  • Total days apart: 812
  • Total weeks apart: 116.0

Useful for siblings, partners, or comparing pet ages with their owners. Uses the same calendar-anchor algorithm as our Age and Date-Duration calculators.

The same algorithm we use everywhere

This tool, the Age Calculator, and the Date Duration Calculator all share one calendar-anchor algorithm: borrow days from the previous month if needed, then borrow months from the year. The result is the intuitive answer that matches Java’sPeriod.between, Python’s dateutil, and spreadsheet DATEDIF.

Why it matters at the boundaries

The naïve approach — subtract milliseconds and divide — drifts wildly across leap years and variable-length months. Two siblings born exactly one calendar year apart should read “1 year, 0 months, 0 days” — not “0 y 11 mo 30 d”. The anchor algorithm produces the right answer for both leap-year and non-leap-year crossovers.

Common uses

  • Sibling age gaps for school registration, pediatric well-visits, family planning.
  • Partner age differences (out of curiosity or for legal/insurance forms).
  • Twin separation (down to days/weeks where time-of-birth doesn’t matter for your purpose).
  • Comparing dog or cat age (use our Dog Age and Cat Age calculators in parallel).

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.