Count the days between two dates
Published · Updated 3 min read
From 1 to 31 January, there are 30 days, 31 days or 22 days depending on how you count. Knowing which one you want avoids being a day out on a withdrawal period, a notice period or a deadline.
Three ways of counting the same interval
Calculate date duration gives three totals for each interval.
| From 1 to 31 January 2026 | Result |
|---|---|
| Gap, start not counted | 30 days |
| Dates included | 31 days |
| Monday to Friday, dates included | 22 days |
The gap is the difference between the two dates: the start date is not counted. With dates included, you add one day. From 31 December 2026 to 1 January 2027, the gap is 1 day and the total with dates included is 2 days.
Knowing whether the first day counts
A 30-day period starting on 1 January ends on 31 January if the first day is not counted, on 30 January if it is. The text of the contract or the rules settles it: find the exact wording there before choosing the total.
Monday to Friday days
The Monday to Friday total counts both dates if they fall on a weekday. It does not remove public holidays: remove them by hand by spotting them on a calendar. A few examples of totals: 22 days for January 2026, 42 days from 31 January to 31 March 2026, 1,779 days from 1 January 2020 to 26 October 2026.
Months are calendar months
The tool calculates complete calendar months. When the day does not exist in the month of arrival, it falls back on the last day of the month.
| Interval | Gap | Complete months |
|---|---|---|
| 15 January to 15 April 2026 | 90 days | 3 |
| 31 January to 31 March 2026 | 59 days | 2 |
| 31 January to 28 February 2026 | 28 days | 1 |
| 1 January 2026 to 1 January 2027 | 365 days | 12, that is 1 year |
Leap years
From 29 February 2024 to 28 February 2025, the tool announces 365 days and 1 complete year. A calendar year has 365 or 366 days: for a contract, rely on the exact number of days and not on the number of years.
Dates in the wrong order
The tool always takes the positive interval: from 1 March to 1 February 2026, it shows 28 days, as in the reverse order. The Swap button swaps the two dates.
Hours and the clock change
The hours shown are the number of days multiplied by 24. From 28 to 30 March 2026, an interval that contains the switch to summer time in Europe, the tool shows 48 hours without accounting for the lost hour.
For which deadlines
A notice period, a withdrawal period, a trial period or a payment deadline: knowing whether the first day counts avoids being a day out.
Check a result
- Note whether the first day must count, then read the matching line.
- For a Monday to Friday total, remove the public holidays by hand.
- Check a simple case with the same tool, for example two dates 7 days apart.
To convert a date into a number of seconds, see Convert Unix timestamp.
Frequently asked questions
- How do you count the days between two dates?
- Most often, the gap does not count the start day. Counting both dates, you add one day.
- How many working days between two dates?
- The tool gives the Monday to Friday total, dates included. Public holidays are not removed: remove them by hand.
- Does the tool handle leap years?
- Yes. From 29 February 2024 to 28 February 2025, it announces 365 days and 1 complete year.
- What happens if the dates are in the wrong order?
- The tool always takes the positive interval. The Swap button swaps the two dates.
