---
url: https://findutils.com/blog/how-many-days-between-two-dates-inclusive-counting-and-month-end-math
title: "How Many Days Between Two Dates? Inclusive Counting, Month Ends and Why Calculators Disagree"
description: "Subtracting two dates gives an exclusive count; add 1 when both days count. Why 31 January plus one month is 28 February, why calculators disagree on months but not on days, how deadlines are counted, and the time zone off-by-one."
category: calculators
content_type: blog
cluster: time
locale: en
read_time: 8
status: published
author: "olgunozoktas"
published_at: 2026-10-29T15:08:00Z
excerpt: "Two dates have one day count but more than one month count. Subtraction leaves the first day out, so inclusive ranges need +1. Month arithmetic has to decide what one month after 31 January is, and good libraries answer 28 February. This post walks through the fencepost rule, legal deadline counting, month-end examples, daylight saving and the time zone bug that moves a date back by one day."
tag_ids: ["dates", "days-between-dates", "date-math", "time-zones", "deadlines"]
tags: ["Dates", "Days Between Dates", "Date Math", "Time Zones", "Deadlines"]
primary_keyword: "how many days between two dates"
secondary_keywords: ["inclusive vs exclusive days", "count days including end date", "months between two dates", "add one month to january 31", "date off by one day javascript", "business days between dates"]
tool_tag: "date-difference-calculator"
related_tool: "date-difference-calculator"
related_tools: ["date-difference-calculator", "time-difference-calculator", "age-calculator", "unix-timestamp", "timezone-converter", "countdown-timer"]
updated_at: "2026-10-29T15:08:00Z"
og_image: "/images/content/blog/how-many-days-between-two-dates-inclusive-counting-and-month-end-math-cover-20261029.webp"
image_alt: "A row of fence posts on a dark navy background with a date under each post and day labels on the gaps between them, the last post highlighted in orange."
---

The number of days between two dates is the later date minus the earlier one. That count is **exclusive**: it counts the steps from one date to the next, so 1 March to 31 March is **30 days**. When both the first and the last day should count, as in "the course runs 1–31 March", add **1** and you get **31**. Days have one right answer. **Months do not**: 31 January to 1 March can honestly be "29 days" or "1 month 1 day", depending on what the tool thinks one month after 31 January is.

You can check any of the examples below in the FindUtils [Date Difference Calculator](/calculate/date-difference-calculator/), which shows the day count, the weeks and a years-months-days line for two dates.

## Days Are Fence Gaps, Not Fence Posts

Picture each date as a fence post. Subtraction counts the **gaps** between posts, not the posts. Five posts in a row have four gaps; Monday to Friday is 4 days apart, but it is 5 days if you are counting the days you worked.

| Question | Count | Example: 10 May to 14 May |
|---|---|---|
| Nights in a hotel | Exclusive (subtract) | 4 nights |
| Days until an event | Exclusive (subtract) | 4 days to go |
| Days a conference runs | Inclusive (subtract, then +1) | 5 days |
| Days charged at a daily rate, first and last day billed | Inclusive (+1) | 5 days |

The mistake happens when one person thinks in posts and the other in gaps. Before you count, decide whether the start date is a day you **spend** or a point you **leave from**.

## How Deadlines Are Counted

Contracts, courts and agencies settle the question in writing. A well-known example is Rule 6(a)(1) of the US Federal Rules of Civil Procedure. For a period stated in days or longer, it says to:

- **"exclude the day of the event that triggers the period"**,
- **"count every day, including intermediate Saturdays, Sundays, and legal holidays"**, and
- **"include the last day of the period"**, unless it is a Saturday, Sunday or legal holiday, in which case the period runs until the next day that is not.

That is exclusive counting with a weekend rollover. Take an event on **Thursday 29 October 2026** and a 30-day period:

1. Day 1 is Friday 30 October, the day after the event.
2. Day 30 is **Saturday 28 November 2026**, which is also what 29 October + 30 days gives.
3. Saturday and Sunday do not end a period, so the deadline moves to **Monday 30 November**.

The committee notes explain why many court periods are now 7, 14, 21 or 28 days: "the 14th day after a Monday, for example, is a Monday." A multiple of 7 always ends on the same weekday as the start.

Rules differ between countries and contracts, so read the clause that applies to you. The arithmetic part, though, is always "subtract, then decide about the first day, then check the weekday".

## Business Days Are a Second Count

A calendar day count includes weekends. For working days, start from the calendar count:

1. Each full week has **5** weekdays.
2. Count the weekdays in the leftover days by hand.
3. Remove public holidays that fall on weekdays.

Monday 2 November 2026 to Monday 30 November 2026 is 28 days, exactly 4 weeks, so **20** weekdays. Thanksgiving in the United States falls on Thursday 26 November 2026, which leaves **19** business days there and 20 in most other countries.

## Months: Where Calculators Disagree

A month is not a fixed number of days, so a tool that reports "X months and Y days" has to decide what adding one month means when the day does not exist in the next month.

Python's dateutil documents its rule plainly: "If the result falls on a day after the last one of the month, the last day of the month is used instead." Its own examples show `date(2003,1,31) + relativedelta(months=+1)` giving **28 February 2003**. JavaScript's Temporal API makes the same choice by default: its overflow option defaults to `'constrain'`, and its docs show 31 March 2019 minus one month as **28 February 2019**.

Once "one month after 31 January" is 28 February, the differences follow. We ran the same date pairs through Temporal's `until()` with years as the largest unit, and through dateutil:

| From | To | Days | Temporal and dateutil | Day-of-month method |
|---|---|---|---|---|
| 31 Jan 2026 | 28 Feb 2026 | 28 | 1 month | 28 days |
| 31 Jan 2026 | 1 Mar 2026 | 29 | 1 month 1 day | 29 days or 1 month 1 day, depending on the tool |
| 1 Mar 2026 | 31 Mar 2026 | 30 | 30 days | 30 days |
| 29 Feb 2024 | 28 Feb 2025 | 365 | 1 year | 11 months 30 days |

The "day-of-month method" is the one people use by hand: compare the day numbers and borrow a month when the end day is smaller. It never calls 31 January to 28 February a month, because 28 is less than 31. Neither answer is wrong. They answer slightly different questions.

Spreadsheets add a third behaviour. Microsoft's own page for Excel's `DATEDIF` warns that the `"MD"` unit, which returns the days left after whole months, "may result in a negative number, a zero, or an inaccurate result", and suggests that for a plain day count you simply subtract one date from the other.

Three practical rules come out of this:

- **When money or a deadline depends on it, state the period in days.** "30 days" is the same in every system. "1 month" is not.
- **When you need months, say which rule you use**, for example "same day number next month, or the last day of the month if that day does not exist".
- **Check birthdays on 29 February.** Libraries that clamp to the month end say someone born on 29 February 2024 turns 1 on 28 February 2025; other rules say 1 March. The [Age Calculator](/calculate/age-calculator/) is the place to check an age.

## Days Are Not Always 24 Hours

In places with daylight saving time, one day each spring has 23 hours and one day each autumn has 25. A date difference in days is right, but **days × 24 is not the clock time** across those changes. The same Rule 6 committee notes give an example: a 72-hour period that starts at 10:23 a.m. on Friday 2 November 2007 "will run until 9:23 a.m. on Monday, November 5", because the clocks went back during the weekend.

If hours matter, measure between two date-times in the same time zone, or use the [Time Difference Calculator](/calculate/time-difference-calculator/) for two clock readings. For meetings across regions, convert first with the [Timezone Converter](/productivity/timezone-converter/).

## The Time Zone Off-by-One

The most common date bug in web forms is a day that moves backwards. In JavaScript, a date-only string such as `"2026-03-01"` is read as **midnight UTC**. MDN's page on `Date.parse()` says it plainly: a date-only value "will imply UTC time". Show that moment in local time in New York and it is still the evening before:

```js
// Device time zone: America/New_York
const d = new Date("2026-03-01");
d.getDate();     // 28  (local: Sat 28 Feb 2026, 19:00)
d.getUTCDate();  // 1
```

Any code that reads a date-only value as UTC and then asks for the local day, month or year will be one day off for everyone west of UTC, and for some dates the shift crosses into the previous month. The day **difference** between two such values is still right, because both move by the same amount, but a "months and days" breakdown built from the local parts can change with the user's time zone.

Two ways to avoid it:

- Keep plain dates as plain dates: Temporal's `PlainDate` has no time zone at all.
- If you must use `Date`, read and write the parts with the UTC methods (`getUTCDate()` and so on), or parse with an explicit local time such as `"2026-03-01T00:00"`.

If your dates come from logs or APIs as numbers, convert them with the [Unix Timestamp Converter](/developers/unix-timestamp/) first, and check whether they are seconds or milliseconds; [this post](/blog/unix-timestamp-seconds-vs-milliseconds/) explains the difference.

## A Checklist for Counting Days

1. **Subtract** the dates to get the exclusive day count.
2. **Add 1** if both the first and the last day are days you count.
3. **Check the weekday** of the last day if a deadline cannot end on a weekend or holiday.
4. **Use days, not months,** for anything paid or legally binding, or write down your month rule.
5. **Do not multiply by 24** across a daylight saving change; measure the clock time instead.
6. **Watch the time zone** when software turns a date into a date-time.

Need help with a project? The team behind FindUtils takes on freelance work through [Upwork](https://www.upwork.com/freelancers/~010a5875eab37b4bd7), including [a Laravel Livewire app or admin panel with dynamic pages and forms](https://www.upwork.com/services/product/development-it-a-laravel-livewire-app-or-admin-panel-with-dynamic-pages-and-forms-2112447485311211142).

## FAQ

### How do I count the days between two dates including both dates?

Subtract the earlier date from the later one and add 1. 1 March to 31 March 2026 is 30 days apart and 31 days counted inclusively.

### Why do two calculators give different months for the same dates?

They use different rules for adding a month to a date near the end of the month. Libraries such as dateutil and Temporal treat 31 January plus one month as 28 February; a day-number comparison does not. The day count is the same in both.

### What is one month after 31 January?

In dateutil and Temporal's default mode it is 28 February, or 29 February in a leap year. Some systems roll over to 2 or 3 March instead, so write the rule into contracts and specs.

### Does "within 30 days" include the first day?

Under US Federal Rule of Civil Procedure 6(a), no: the day of the triggering event is excluded and the last day is included, with a rollover past weekends and legal holidays. Other rules can differ, so read the one that applies.

### Why is my date one day earlier in the browser?

A date-only string like "2026-03-01" is parsed as midnight UTC. West of UTC that moment is still the previous evening locally, so local getters return the day before. Use UTC getters or a time-zone-free date type.

## Related Reading

- [Date Difference Calculator guide](/guides/date-difference-calculator-guide/)
- [Time Difference Calculator guide: hours between two times, including overnight shifts](/guides/time-difference-calculator/)
- [Unix timestamps: seconds vs milliseconds](/blog/unix-timestamp-seconds-vs-milliseconds/)

## Sources

- [Federal Rules of Civil Procedure, Rule 6: Computing and Extending Time, with committee notes (Cornell LII)](https://www.law.cornell.edu/rules/frcp/rule_6)
- [dateutil relativedelta documentation](https://dateutil.readthedocs.io/en/stable/relativedelta.html)
- [Temporal.PlainDate documentation (TC39 proposal docs)](https://tc39.es/proposal-temporal/docs/plaindate.html)
- [MDN: Temporal.PlainDate.prototype.until()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate/until)
- [MDN: Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)
- [Microsoft Support: DATEDIF function](https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c)
