How this calculator works
Completed years are counted on the calendar, not by dividing the day total by 365. A year is complete when the same day of the month has been reached, and a February 29 start is clamped to February 28 in a common year. After the whole years are removed, the remaining interval is counted in whole months and leftover days, so the three parts always add back up to the calendar. The anniversary table repeats the same yearly step, which is useful for service dates, leases and savings goals. Including the end date adds one day before the count, which can complete another year when the end date is the day before an anniversary.
Formula
Let E be the end date, moved forward one day when the end date is included. years is the largest whole number y for which the start date plus 12y months is not after E, with the day clamped to the target month length. months is the largest whole number m for which the start date plus m months is not after E. breakdown days = O(E) - O(start date plus the whole months). total days = O(E) - O(start date).
Worked example
From 2024-01-31 to 2026-11-01 is 2 completed years, 33 whole months and 1,005 days, written as 2 years, 9 months and 1 day. The first anniversary is 2025-01-31 and the second is 2026-01-31. From 2026-01-01 to 2026-12-31 with the end date included is exactly 1 year and 365 days.
Advertisement
Frequently asked questions
How is a February 29 start handled?
The yearly step clamps to February 28 in a common year and returns to February 29 in a leap year. So a person or contract starting on 2024-02-29 reaches the second anniversary on 2026-02-28, not on a date that does not exist.
Why is the whole-month figure larger than twelve times the years?
The whole-month count does not stop at each anniversary. It counts every complete month from the start, so 2 years and 9 months is 33 whole months. The years and months breakdown separates the same interval into a more familiar form.
Why not divide the total days by 365?
Leap years make the average year 365.2425 days, and the answer would drift with the starting point. Calendar counting keeps each anniversary on the same date, which is how leases, service and age are normally described.
Should I include the end date?
Include it when both the first and last day count, such as a three-day event. Leave it out when you are measuring the boundary gap between two dates. On a year boundary the choice can change the answer by one full year.