Date Difference Calculator
Pick two dates to see exactly how far apart they are: as years, months and days, and as total days, weeks and hours. The calculation uses the real calendar, including leap years and months of different lengths, and you can choose to count the end date too. Everything runs in your browser.
Result
The end date is before the start date, so the dates were swapped to give a positive difference.
- Total days
- In weeks
- Whole months
- Total hours
- Start date falls on
- End date falls on
Examples
Worked examples:
| From | To | Difference | Total days |
|---|---|---|---|
2020-01-01 | 2020-03-01 | 2 months | 60 |
2021-01-31 | 2021-03-01 | 1 month, 1 day | 29 |
2000-02-29 | 2026-09-29 | 26 years, 7 months | 9,709 |
2023-12-31 | 2024-01-01 | 1 day | 1 |
Formula & Methodology
Every date becomes a day number, so the total number of days is an exact subtraction. For years, months and days, whole calendar months are counted from the earlier date, and the days are what remains. When the earlier day does not exist in a later month, the last day of that month is used: 31 January plus one month is 28 February (29 in a leap year).
Notes and limitations
- Dates are plain calendar dates with no time zone or time of day. Hours are simply days ร 24, and daylight-saving changes are not applied.
- The calendar is the Gregorian calendar extended backwards. Dates before its introduction in 1582 are not adjusted for older calendars.
- Counting the end date adds one day to every figure.
- Month lengths vary, so โ1 monthโ is not always the same number of days.
- Supported dates run from year 1 to year 9999.
How to Use
- Choose the start date and the end date.
- Tick โCount the end date tooโ if the last day should be included.
- Read the difference in years, months and days and the totals.
- Use the swap button to compare in the other direction.
Frequently Asked Questions
How many days are there between two dates?
Subtract one date from the other. The calculator does this exactly with the real calendar, so leap days are included. From 1 January 2020 to 1 March 2020 there are 60 days.
Should I count the end date?
Counting only the days that pass gives the plain difference. If both the first and the last day count (for example a hotel stay or a deadline that includes the final day), tick the option to add one day.
How are months counted when the days do not match?
Whole months are counted from the earlier date. If a month is too short for the start day, the monthโs last day is used: 31 January plus one month is 28 February, so 31 January to 1 March is 1 month and 1 day.
Does it handle leap years?
Yes. 29 February exists only in leap years, and the totals of days are exact for any range from year 1 to 9999.
Is anything sent to a server?
No. The calculation runs in your browser and nothing you enter is uploaded or sent to analytics.
Last updated: