The negative-day problem
A common shortcut subtracts the day numbers, month numbers and year numbers independently. If the day result is negative, the code borrows the length of the previous month. That can still leave a negative number. From 31 January to 1 March 2025, the first subtraction is 1 minus 31. Borrowing February's 28 days changes −30 to −2. An age result with −2 remaining days is a sign that the method needs attention.
Move through real dates
Our method starts at the earlier date and moves forward. A month after 31 January is clamped to the final available day in February, which is 28 February in 2025. The remaining day reaches 1 March. Under that convention, the interval is 0 years, 1 month and 1 day. The total elapsed calendar days are 29.
Clamping means using the last valid day when a target month has fewer days than the original date. It avoids rolling a February result into March. It also means adding a month and subtracting a month may not return to the same date. For example, 31 January plus one month becomes 28 February, and subtracting one month from that result gives 28 January.
Choose a leap-day anniversary
People born on 29 February need a convention when the reference year has no 29 February. Our age and birthday tools offer 28 February and 1 March. Choose the one appropriate to your personal use. The setting can change a completed age near the end of February. It does not change the number of elapsed calendar days between the original dates.
Calendar time and elapsed clock time
A calendar day is a date on the calendar. A local-clock day around a daylight-saving transition can span a different number of hours. We count dates using a uniform calendar representation, so a change in your clock's UTC offset does not turn a two-date interval into a fractional number of days. The figures are suitable for calendar planning.
Check the convention before comparing tools
Month-end conventions can differ between calculators. Compare the method and total day count as well as the years-months-days breakdown. A useful result includes its starting date, reference date and handling of leap-day birthdays. Those details let you tell a difference in convention from a calculation error.