How this calculator works
Both birth dates are converted to day numbers in the proleptic Gregorian calendar and the absolute difference is taken. Because the result is a raw day count rather than a difference of rounded ages, leap days are included exactly where they fall. The older field names the earlier date as a, b or same.
Formula
difference_days = |O(birth_date_b) - O(birth_date_a)|, and older is a when O(birth_date_a) is smaller, b when the second is smaller, and same when the dates match. O(d) is the day number with 0001-01-01 as day 1.
Worked example
A person born 1990-05-20 and another born 1992-08-10 are 813 days apart, and the first date is earlier. Two people born on 2000-02-29 are 0 days apart.
Advertisement
Frequently asked questions
Does a leap-day birthday change the difference?
The day count already includes every February 29 between the two dates. There is no anniversary rule to apply, because the answer is a day gap rather than an age in years.
What does the older field mean?
It names the earlier of the two supplied dates: a for the first, b for the second, or same when both dates are identical.
Why is a difference in days used instead of years?
Years hide the months and days between birthdays. A day count is exact and does not depend on how completed years are defined.