Pick the two dates
In any order: the result is the same.
Pick two dates and see the time between them as years, months and days, as a total number of days, weeks and hours, and as business days.
100% private — the calculation is done in your browser and nothing is sent to any server.
Guide: What week of the year is it? How ISO week numbers work
Keep going with your result in another tool. Nothing is uploaded.
In any order: the result is the same.
Count it if you need an inclusive range, such as a hotel stay or a leave period.
Years, months and days, total days, weeks, hours and business days.
The question comes up all the time: how many days until an event, how long a contract lasted, how long since something happened, how many days of leave are covered by a period, how far apart two milestones on a project are. Counting on a calendar is slow and full of traps, such as months of different lengths and leap years. This calculator gives the answer in several forms at once.
The first result is a calendar difference, the way a person would say it: for example "1 year, 2 months, 3 days". It is worked out by counting whole years, then whole months, then the remaining days, taking into account the real length of each month, so it does not depend on averages. Because months are unequal, the number of months and days can differ from what you get by dividing the total days by 30.
The total number of days is exact and unaffected by daylight saving changes, because dates are treated as pure calendar days. From it come the weeks, with the remainder in days, and the hours and minutes, which are simply days multiplied by 24 and 1,440. Use them for a quick sense of scale, such as "18,000 hours".
By default the end date is not counted: from the 1st to the 2nd is one day. If you need both the first and last day, as for a hotel booking where the nights count, a period of annual leave or a course that runs from one date to another, tick the inclusive option, and the 1st to the 2nd becomes two days.
The last result counts the weekdays, Monday to Friday, between the dates. It does not subtract public holidays, which vary by country and region. If you need to exclude specific holidays, use the business days calculator, where you can list them and choose which days are the weekend.
It works with calendar dates, not times of day or time zones. It uses the Gregorian calendar for all dates, including those before its adoption. To add or subtract time from a date instead, use the add days to a date tool.
A date is a whole number in a spreadsheet, so most of this is plain subtraction. With the start date in A2 and the end date in B2 (here 10 February 2024 and 17 October 2026):
| To get | Formula | Result |
|---|---|---|
| Days between the dates | =B2-A2 | 980 |
| The same, as a function (end date first) | =DAYS(B2, | 980 |
| Counting both the first and the last day | =B2-A2+1 | 981 |
| Complete years | =DATEDIF(A2, | 2 |
| Months left over after the years | =DATEDIF(A2, | 8 |
| Days left over after the months | =B2-EDATE(A2, | 7 |
| Complete weeks | =INT((B2-A2)/7) | 140 |
The formulas use English function names and commas. If your Excel or Google Sheets is set to another language, the function names change, and in many countries the separator between arguments is a semicolon.
=B2-A2 behaves the same way, and +1 matches the inclusive option.DATEDIF is documented by Microsoft and by Google Sheets. Avoid its "MD" unit: Microsoft says it "may result in a negative number, a zero, or an inaccurate result", which is why the days left over are worked out from EDATE above.=B2-A2. Add 1 if both the first and the last day count. For whole months or years use =DATEDIF(A2,B2,"M") or "Y". It works the same in Google Sheets.More utilities that also run without leaving your browser.