Counting Days Between Dates

Why two people can count the same date range and get different answers: inclusive and exclusive counting, calendar days versus elapsed time, and month-based spans.

Key facts

  • Exclusive counting gives the exact number of days between two dates: 1 January to 2 January is 1 day.
  • Inclusive counting counts both the first and the last date, so the same range is 2 days.
  • Months have no fixed length, so month-based spans use month-end clamping rather than a number of days.
  • Days containing a clock change last 23 or 25 hours, so elapsed time is not always a multiple of 24.
  • Working-day counts are a subset of calendar days, set by the working week and by holidays you enter.

Exclusive and inclusive counting

Two people count the same span and get different answers because one counts the gaps and the other counts the markers. From 1 January to 2 January there is a single gap between two dates, so exclusive counting gives 1 day. Counting both the arrival and the departure as days gives 2 days.

The difference is exactly one day in every case. There is no range for which the two conventions differ by more, so identifying the convention is the whole task: subtract the start from the end, or subtract it and add one.

Which convention fits the situation

Nights in a hotel are exclusive. A booking from 15 June to 18 June is 3 nights, not 4: you stay the nights of 15, 16 and 17 June and leave on the morning of the 18th, so the end date is not counted.

Days of attendance are inclusive when both ends are attended. A festival running from Friday 4 July to Sunday 6 July 2025 lasts 3 days, although subtracting the dates gives 2. The same applies to leave from a first to a last day off, or a course attended on both its first and last date.

Deadlines phrased as "within 30 days of" are the awkward case, because the count depends on the exact wording and on the law or policy being applied. Some read the 30 days as running from the day after the trigger date, others count the trigger date itself. Check the specific wording rather than assuming.

Calendar days and business days

A calendar day is any day on the calendar, weekends and public holidays included. A business day is a working day of the week, normally Monday to Friday, minus any holiday you choose to exclude. A fortnight is 14 calendar days but, with a Monday to Friday week and no holidays, only 10 business days.

Business-day counting has its own boundary rule: by default the range includes the start date if it is a working day and excludes the end date, and an option makes the end date count too. A holiday reduces the count only when it falls on a working day, and business days plus weekend days plus holidays always add back up to the calendar days in the range. DateUtils has no built-in holiday calendar, so holidays are only those you enter. The conventions are set out in the business days reference, and the business days calculator applies them to any date range you enter.

Calendar days and elapsed time

A calendar day is a label on a calendar, not a measured duration. Where clocks move forward, the day that contains the change is 23 hours long; where clocks move back, it is 25 hours. In the United Kingdom, clocks go forward on the last Sunday in March and back on the last Sunday in October, so those two Sundays are 23 and 25 hours long.

So the hours between two clock times are not always the number of days times 24. Two dates with no time of day carry no information about which side of a clock change they fall on, which is why hour figures derived from bare dates are arithmetic conveniences rather than measurements. For anything measured against real time, use real instants in a named time zone; see time zones and daylight saving.

How DateUtils counts

The DateUtils date difference calculator reports the exact number of days between two dates as the end date minus the start date, always as a non-negative number with a note giving the direction. The start date is never counted as an extra day. An include-end-date option adds exactly one day, which converts the exclusive result into the inclusive one.

Hours and minutes follow from the day count: hours are days times 24, and minutes are days times 24 times 60, because date-only inputs carry no clock-change information. The full set of rules is in the date difference methodology, and the date difference calculator lets you switch between the two conventions with the include-end-date option.

Months, weeks and days

Months cannot be converted into days by a fixed rate, which is why month-based spans are counted differently. Whole months are counted forward from the earlier date, and where the earlier day of the month does not exist in the target month it is clamped to that month's last day. 31 January to 28 February in a common year is therefore exactly 1 month, and so is 28 February to 31 March: the same 1-month answer can cover 28 days or 31.

A worked example in days: from Saturday 1 March 2025 to Sunday 1 June 2025 the interval is 92 days exclusive and 93 days inclusive. The same interval is exactly 3 calendar months, because both dates fall on the first of a month. Broken into weeks and days it is 13 weeks and 1 day, since 13 weeks is 91 days. The clamping behaviour and the reason months are handled separately is covered in the adding months reference.

Counting down to a moment rather than to a date

Counting days between two dates and counting down to an event are different measurements. The DateUtils countdown measures real elapsed time from now to a target instant in your own time zone, where a day is 24 elapsed hours; with no clock time entered, the target is midnight at the start of the date. Because it uses a real instant rather than a calendar label, a countdown can differ from a day count on the same dates when a clock change falls between them.

Ages use the same months-and-days rule, counted forward from the date of birth, so a birthday on 29 February is observed on 28 February in common years. The age calculator handles that case explicitly.