Days between dates calculator

The exact gap between two dates in days, plus weeks, calendar months, weekdays and weekend days. Choose whether the end date counts.

Loading the calculator…

Inclusive or exclusive: which count do you need?

Most disagreements about "how many days" come from whether the first day counts. A spreadsheet subtraction, an age and a countdown all use the difference. Leave allowances, event durations and "days on site" usually count inclusively. When a contract or policy matters, check its wording for phrases such as "from and including".

The fencepost problem, counted three ways

A fence 10 metres long with a post every metre needs 11 posts. Dates have the same trap. Tap a day to move the nearer end, then switch the rule.

Difference (end − start): 6 days. The start day is day zero, the same as subtracting dates in a spreadsheet (=B1−A1). Use this for "how long until" and ages.

How leap years are counted

Every 29 February between your dates adds one day, which is why the tape lists the number of leap days inside the range. The Gregorian rule behind that looks simple but has two exceptions.

Why 2100 won't have a 29 February

The Earth takes about 365.2422 days to go round the Sun (the tropical year). Switch each Gregorian rule on and off to see how close the average calendar year gets.

1900: 3651996: 3662000: 3662023: 3652024: 3662100: 365

Average year: 365.2425 days · ahead by one day every 3,226 years against the seasons.

That is the real Gregorian rule (introduced 1582): 97 leap years every 400, so 1900 and 2100 are common years while 2000 was a leap year.

Months and years between dates

Months are measured from the start date's day number: from 10 April, a month is complete on 10 May. When the start day doesn't exist in a later month (the 31st, or 29 February), the count waits until that day number is reached, matching ISO 8601 libraries like Temporal and java.time. That's why 31 January to 28 February is shown as 28 days rather than one month.

Questions people ask

How do I calculate the number of days between two dates?
Convert each date to a running day number and subtract. The calculator does this with a fixed-day-number algorithm, so leap years are handled automatically. By default the start day is not counted (1 to 2 January = 1 day); switch on "include the end date" to count both.
How many days are there between two dates including both dates?
Take the ordinary difference and add one. 1 March to 31 March is 30 days apart, but 31 days inclusive.
How do I count months between two dates?
A month is counted when the same day-of-month is reached. 15 January to 14 March is 1 month and 27 days; 15 January to 15 March is exactly 2 months. From the 31st, a month is counted once the target date reaches the same day number, so 31 January to 28 February is 28 days, not a month.
How do I find the number of weeks between dates?
Divide the day count by 7. The tape shows whole weeks plus the remaining days, for example 100 days = 14 weeks 2 days.
Does the result change with time zones or daylight saving?
No. Dates are counted as whole calendar days, independent of clocks. If you need exact hours across a DST change or between time zones, use the time duration calculator.
How do I do this in Excel or Google Sheets?
Subtract the cells: =B1-A1 gives the difference, =B1-A1+1 the inclusive count, =DATEDIF(A1,B1,"m") whole months, and =NETWORKDAYS(A1,B1) Monday–Friday working days (both ends included).

Other date calculators