Gregorian date calculator

Date Difference Calculator: Days Between Dates and Inclusive Counts

A date difference counts the day boundaries from a start date to an end date. For the same date it is 0; for adjacent dates it is 1. To count every calendar date in a period, including both its start and end, select Count both start and end dates: the answers become 1 and 2 respectively. The tool includes weekends and uses Gregorian dates without a time of day.

Guide updated 2026-11-12. Dates below are worked examples, not booking or deadline records.

On this page

Result

1 day0 weeks and 1 day

Date difference: count of day transitions between the dates.

Choose the count before entering dates

Ask what one unit represents. A list of dates covered by an activity is different from the time between two date labels. A trip can touch three dates but include two overnight stays. Adding one because a total “looks low” changes the measure instead of correcting the arithmetic.

Original date-only examples
Start dateEnd dateDate differenceBoth dates included
1 November 20271 November 20270 days1 date
1 November 20272 November 20271 day2 dates
1 November 20273 November 20272 days3 dates
31 January 20271 February 20271 day2 dates
28 February 20281 March 20282 days3 dates

On a phone, scroll inside this table for the remaining columns. Keyboard users can focus its border and use the arrow keys.

The checkbox changes the counting convention. It does not alter either input date, remove weekends, change the month length or add a day to the end date. A same-date activity has one included calendar date even though no date boundary separates its endpoints.

Use the calculator and read its result

  1. Enter a complete start date and end date. Confirm their years, especially for leap-day and New Year examples.
  2. Keep the end date on or after the start. If they are reversed, correct the input or decide which direction your question requires.
  3. Leave the checkbox clear for a date difference. Select it for a count of calendar dates including both endpoints.
  4. Read the total first. The weeks-and-days line is only another way to express that same total in seven-day groups.
  5. Keep the input pair and selected convention with any number you put into a plan. A number without those details is hard to check later.

The worked example uses 1 November to 2 November 2027. Its date difference is one day, and its inclusive count is two dates. The example button restores those inputs and clears the checkbox; enter your own dates afterwards.

For a total of 10 days, the second line reads one week and three days. It is not a count of ISO calendar weeks, numbered business weeks or payroll periods. A seven-day remainder grouping does not establish a reporting calendar.

The method: end minus start, then choose the endpoint rule

Represent each valid Gregorian date with its day number in one consistent calendar system. Subtract the start day number from the end day number. When the end is on or after the start, the result is the number of day transitions between them. For a count including both endpoints, add one to that difference.

Date difference: end day number − start day number

Both endpoints included: end day number − start day number + 1

For November 1 through 3, move from the 1st to the 2nd and from the 2nd to the 3rd: two transitions. The included list is November 1, 2 and 3: three dates. This simple trace explains why the two valid answers differ by one.

The implementation converts accepted year, month and day fields to UTC date markers before subtraction. UTC is used as a stable arithmetic coordinate; the inputs themselves are date labels, not claims about the user’s local midnight. A calendar-aware check rejects dates that do not exist rather than letting JavaScript roll them into another month.

Python’s documented date arithmetic provides an independent reference for exact whole-day differences. Its proleptic Gregorian date model applies a consistent calendar rule and supports years 1 through 9999. This tool accepts complete dates in that same year range. Historical calendar adoption and an organization’s deadline rules require separate information.

Cross months and leap day without a fixed-month shortcut

A month boundary does not add a special adjustment. January 31 to February 1 is one transition, whatever January’s length. Do not subtract the two printed day numbers alone: 1 − 31 is not the difference between those full dates.

Leap day changes which dates exist between the endpoints. In 2027, February 28 to March 1 is one day. In 2028 it is two days because February 29 lies between them. With both endpoints included, those totals become two and three calendar dates respectively.

Original leap and year-boundary traces
InputsIncluded dates or transitionsDate differenceInclusive count
28 February–1 March 202728 February → 1 March12
28 February–1 March 202828 February → 29 February → 1 March23
31 December 2027–1 January 202831 December → 1 January12

On a phone, scroll inside this table for the remaining columns. Keyboard users can focus its border and use the arrow keys.

The Gregorian leap rule is divisible by four, except century years that are not divisible by 400. Thus 2000 is leap but 2100 is common. This is why a year field cannot be omitted from a leap-day validation.

If your task is “one calendar month later,” use the separate guide to month-end policies. A fixed number of days and a calendar-month shift are different operations. This calculator does not silently turn every month into 30 days.

Trips, overnight stays and elapsed hours use different units

Suppose a fictional booking starts on November 1 and ends on November 3, 2027. The date difference is two. If each intervening night is one overnight stay, the dates suggest two nights: the night of November 1 and the night of November 2. The inclusive list still has three calendar dates. That list is not automatically a three-night booking.

Confirm the booking provider’s check-in, check-out and charging rules. The calculator does not read reservation records or establish what a hotel charges. An arrival and departure on the same date can have a date difference of zero while still involving hours of use, a day-use charge or a scheduled activity.

Two local date labels also do not determine an exact number of elapsed hours. Timestamps, time zones and daylight-saving transitions can affect the time between local midnights. Multiplying this date-only answer by 24 is not a substitute for comparing fully specified instants.

For ambiguous written inputs such as 10/11/2027, first confirm the date convention. Validating the month length cannot decide whether that string means October 11 or November 10. Resolve its meaning before calculation.

Handle empty, impossible and reversed inputs explicitly

An empty date is missing information, not zero days. Fill both fields before calculating. An impossible date such as April 31 or February 29 in a common year must be corrected; it should not become a valid May or March date without your knowledge.

When the end precedes the start, this tool asks for a correction rather than reporting zero or silently swapping the endpoints. A reversed pair is different from a same-date pair. If you intentionally need a signed interval, state that requirement and use a method that preserves its direction.

The accepted year range is 0001 through 9999. A shape that looks like YYYY-MM-DD still needs a valid calendar date. Browser date fields help with entry, but the calculation also validates the actual fields and checks that conversion preserved the requested date.

After correcting an input, recheck the checkbox. An inclusive count and a date difference remain different even when both dates are valid. Keep the original source values when correcting a file so a later review can tell what changed.

Weekends, closures and several activity periods

This tool includes Saturdays, Sundays and public holidays. For a weekday or business-day answer, first identify the applicable weekend pattern and actual closures. A country, employer, school and service can have different calendars. The business-day guide explains how to state that calendar and check the count.

For several overlapping inclusive periods, adding each period’s total can count the same date twice. Use the unique-days range guide to merge overlaps and preserve gaps. Taking only the earliest start and latest end can wrongly include a date covered by no input.

For deadlines, follow the controlling rule about excluded starting days, included ending days, weekends, holidays, time of day and extensions. This date-only calculator supplies a calculation after the convention is chosen; it does not determine the legal or administrative rule.

Three complete counting decisions

Case 1: a one-date activity

A hypothetical classroom activity starts and ends on November 1, 2027. A planner needs the number of calendar dates covered. Which answer applies?

Show answer and explanation for case 1

Use the inclusive count: one date. The date difference is zero because there is no transition to a later date. The included set is {November 1}, which contains one date. Selecting both endpoints does not make this a two-date activity when the endpoints are equal.

Case 2: a leap-day period

A hypothetical activity covers February 28 through March 1, 2028, with both endpoints included. Is its duration the same count as the covered dates?

Show answer and explanation for case 2

The date difference is two; the inclusive count is three dates. The dates are February 28, February 29 and March 1. Two transitions connect those three dates. Using a common-year February table would omit a valid date and give the wrong count.

Case 3: a reversed record

A file lists a start of November 3 and an end of November 1, 2027. Should the tool return zero days and let the plan continue?

Show answer and explanation for case 3

No. Correct the pair or explicitly choose a signed-interval method. Zero describes equal date labels under the date-difference convention. These labels differ and point backwards. Silently clamping or swapping them discards information about the record’s error or intended direction.

Sources and method checks

For the site’s source policy, read the source notes. The legacy methodology route remains available.