Skip to content
cliplimeClipLime

Date difference calculator

How long is it from one date to another? Get years, months and days, plus the totals, with the working shown.

Difference between two dates

Pick a start date and an end date. The answer counts days on the calendar, so clock changes cannot affect it.

Monday to Friday is 4 days. Switch on to count 5.

Enter both dates to see the gap.

At a glance

What it does
Measures the gap between two dates as years, months and days, and as total days, weeks, months and hours.
Counting rule
End date minus start date, so Monday to Friday is 4 days. One switch counts the end date too, which makes it 5.
Month ends
Years and months are whole. When a month is too short, its last day is used: January 31 to March 1 is 1 month and 1 day.
Weekdays
Also splits the days into weekdays (Monday to Friday) and weekend days.
Backwards
An end date before the start date is measured backwards, and the answer says so. Numbers are never negative.
Range
Any date from the year 1 to 9999 on the Gregorian calendar. Leap days are counted for you.
Privacy
Nothing is sent when you type. Your dates are kept in the page address so a link can be shared, so a shared link carries them.

How to do it

  1. 1

    Pick the two dates

    Choose them from the calendar, or type them in the order the boxes show. Today fills in the current date. Swap dates exchanges the two.

  2. 2

    Choose how to count

    Leave Count the end date too off to measure end minus start. Switch it on to count both the first and the last day.

  3. 3

    Read the gap

    The big line gives years, months and days. Under it are the total days, weeks, months, hours and the weekday split.

  4. 4

    Check or share

    The working lists the dates passed on the way. Copy result copies a sentence, and Copy link opens the same two dates for someone else.

How the gap is measured

The calculator moves forward from the earlier date in whole years, then whole months, then days. From March 1, 2024 to October 6, 2026: 2 years takes you to March 1, 2026, 7 more months to October 1, 2026, and 5 more days to October 6. The answer is 2 years, 7 months and 5 days, which is 949 days in total.

Months are not all the same length, so the days left over depend on where you start. Moving by one month from January 31 would land on a day that does not exist, so the last day of the shorter month is used: February 28, or February 29 in a leap year. Then the remaining days are counted from there. That is why January 31 to March 1 is 1 month and 1 day, and 29 days in total in 2023 or 30 in 2024.

Should the end date count?

Most spreadsheets and programming languages subtract: end date minus start date. That is the number of days that pass, or the number of nights in a stay. Monday to Friday is 4. Counting both days gives the number of calendar days a stay, course or project covers: 5. Neither is wrong, but they answer different questions.

  • Leave it off for how long until a date, how old something is, or the number of nights.
  • Switch it on when the wording says "inclusive", "including the last day" or "from the 1st to the 5th" for the days involved.

If a contract, form or rule gives the answer in words, follow its wording and use the switch to match.

Leap years, month ends and clock changes

Leap days are counted for you: January 1, 2024 to January 1, 2025 is 366 days, because 2024 contains February 29, while January 1, 2023 to January 1, 2024 is 365. A year is a leap year when it divides by 4, except century years, which must divide by 400. So 2000 was a leap year and 1900 was not.

Only calendar dates are used, never clock times. Daylight saving changes and time zones cannot add or remove an hour from the answer, and the hours figure is simply days × 24.

Dates are counted on the Gregorian calendar for every year, as computers do. Historical dates from before a country adopted it (1582 in some countries, 1752 in Britain and its colonies, later elsewhere) may not match the calendar that was in use at the time.

In a spreadsheet

In Excel or Google Sheets, a date is a number, so subtracting gives days: put the earlier date in A1 and the later one in B1, and =B1-A1 is the same count this calculator gives with the end date left out. Add 1 to include the end date. DATEDIF(A1,B1,"m") gives whole months. For working days only, use the working days calculator.

Questions people ask

How do I calculate the number of days between two dates?

Subtract the earlier date from the later one. March 1 to March 31 is 30 days. Switch on Count the end date too to get 31, which counts both March 1 and March 31.

Does the calculator include the end date?

Not unless you switch on Count the end date too. By default it measures end minus start, the same as subtracting dates in a spreadsheet. The label above the answer says "with both dates counted" whenever the switch is on.

Why is January 31 to March 1 one month and one day?

One month after January 31 is February 28, because February has no 31st (February 29 in a leap year). From there it is one more day to March 1. In total it is 29 days in 2023 and 30 days in 2024.

What happens if the end date is before the start date?

The gap is measured backwards between the two dates and shown as a positive length, with a label that says it counts back. The working notes which date came first. Swap dates puts them in order.

Do leap years or daylight saving time change the result?

Leap years do, correctly: every February 29 in the range adds a day, and the working names how many it found. Daylight saving does not matter, because only calendar dates are used and no clock times are involved.

Is anything I type stored or sent?

No. Typing sends nothing anywhere: the sums run in your browser. Your dates are also kept in the page address so that Copy link works. That means a link you share, or a page you reload, requests that address, dates included, from our server like any web address. Share a link only if you are happy to share the dates.