Calculate the time between two dates
Two dates of birth, or any two dates
How this age calculator between two dates works
Reads two calendar dates
Only the day, month and year are used. There is no time of day and no time zone.
Puts the earlier date first
The order you enter the dates in does not matter.
Counts whole years and months
From the earlier date to the later one.
Borrows days when needed
If the later date’s day number is smaller, days are borrowed from the month before the later date. For 31 January to 29 February: 29 − 31 = −2, plus the 31 days of January gives 29 days.
Adds the totals
Total days is the exact number of calendar days between the dates; the end date is not counted. Total weeks is total days ÷ 7, rounded down. Total hours is total days × 24.
Examples
| First date | Second date | Years, months, days | Total days |
|---|---|---|---|
| Jan 1, 2024 | Jan 1, 2025 | 1 year, 0 months, 0 days | 366 |
| Jan 31, 2024 | Feb 29, 2024 | 0 years, 0 months, 29 days | 29 |
| Feb 29, 2024 | Feb 28, 2025 | 0 years, 11 months, 30 days | 365 |
| Dec 31, 1999 | Jan 1, 2000 | 0 years, 0 months, 1 day | 1 |
| Mar 15, 1985 | Sep 20, 1990 | 5 years, 6 months, 5 days | 2,015 |
Why the breakdown and the totals look different
Years, months and days follow the calendar, while the totals count every day. January 1, 2024 to January 1, 2025 is exactly 1 year on the calendar, but 2024 is a leap year, so the totals show 366 days and 52 weeks (366 ÷ 7, rounded down).
The totals describe the same span in other units; they are not extra time on top of the breakdown. A 29-day span shows 4 total weeks and 29 total days, not “4 weeks plus 29 days”.
Leap years and month ends
The tool counts real calendar days, so February 29 is included when it falls in the range. Month-end dates are where results are most sensitive: January 31 to February 29 is 0 months and 29 days, and February 29, 2024 to February 28, 2025 is 0 years, 11 months and 30 days (365 days), because 28 is lower than 29 and a full year has not been reached.
Check the result in Excel
With the earlier date in A1 and the later date in B1, these formulas give the same three parts: =DATEDIF(A1,B1,"y") for years, =DATEDIF(A1,B1,"ym") for months and =DATEDIF(A1,B1,"md") for days. For total days, use =B1-A1.
The first three rows of the examples table gave the same results in Excel’s DATEDIF as in this calculator. Month-end dates are where tools are most likely to disagree, so test those first if you compare results.
Are my dates stored?
The calculation runs in your browser with JavaScript, and the dates you enter are not sent to or stored on our server. This site shows Google ads; see our Privacy Policy for how those work.
Why subtracting years gives the wrong answer
Subtracting years only compares the year numbers. December 31, 1999 and January 1, 2000 are 1 year apart by year number, but only 1 day apart. In the other direction, January 15, 1990 and September 20, 1995 look like 5 years apart, but the actual gap is 5 years, 8 months and 5 days. Using the full dates avoids both mistakes.
When you need the exact time between two dates
Any two dates, not only birthdays
Both fields accept any calendar date, so you can measure the gap between two birthdays, a start and an end date, or two historical dates.
Family and genealogy
The exact gap between siblings, cousins or generations helps check whether dates in family records are plausible.
School year groupings
Whether two children fall in the same school year depends on where their birthdays sit relative to the annual cutoff. Two children born three months apart can be a school year apart if their birthdays straddle the cutoff, and the exact gap shows how close they are.
Frequently asked questions
Enter both dates and read the Total days figure. It counts the calendar days from the earlier date to the later one, and the end date is not counted: 1 January 2024 to 2 January 2024 is 1 day. 1 January 2024 to 1 January 2025 is 366 days.
Yes. It counts real calendar days, so 29 February is included when it falls in the range. That is why 1 January 2024 to 1 January 2025 is 366 days, while 29 February 2024 to 28 February 2025 is 365 days.
The calculator counts a full month or year only once the later date’s day number reaches the earlier date’s day number. 28 is lower than 29, so it counts 11 whole months and 30 remaining days. The total is 365 days.
For the first three examples in the table on this page, the results matched Excel’s DATEDIF function. Month-end dates are where tools are most likely to disagree, so test those first if you compare results.
No. The calculator puts the earlier date first automatically and tells you which of your two dates is the earlier one.
Yes. Any two calendar dates work, such as the start and end of a project or two historical dates. The result is the exact time between them.
The calculation runs in your browser, and the dates you enter are not sent to or stored on our server.