ThisCalculator

Date and time

Days Between Dates: Calculate the Exact Number

Updated · Standard formula, shown below

Days between dates 10 days
Days including both dates
11 days
Result
Start date (days from 1970-01-01)
20000 days
You entered
End date (days from 1970-01-01)
20010 days
You entered

Days Between Dates: Calculate the Exact Number

Calculate the number of calendar days between a start date and an end date by entering both dates. The calculator returns the elapsed days, with the end date excluded by default; include both dates when that is the count you need.

Formula

Elapsed days = end date − start date. Dates are converted to consecutive day numbers, so subtracting the earlier day number from the later one gives the number of midnights crossed. For an inclusive count that includes both the start and end dates, use end date − start date + 1.

  • Start date: the earlier calendar date, represented as a day number in days from 1970-01-01.
  • End date: the later calendar date, represented in the same units.
  • Days between dates: elapsed calendar days, excluding the start date and counting up to the end date.
  • Days including both dates: an inclusive calendar-day count.

The date numbers in the specification are a compact way to describe the calculation, not dates readers need to convert by hand. In a working date calculator, you select dates on a calendar; the tool applies the same subtraction. The example defaults represent 2024-10-04 and 2024-10-14.

Worked Example

Using the default dates, October 4, 2024, is the start and October 14, 2024, is the end. Their day numbers are 20,000 and 20,010, respectively.

  1. Subtract the start day number from the end day number: 20,010 − 20,000 = 10.
  2. The elapsed time is 10 days.
  3. For a count that includes October 4 and October 14, add one: 10 + 1 = 11 calendar days.

The difference is the elapsed duration. The inclusive answer counts the labeled dates on a calendar, which is a different question.

How to Count Days Correctly

“How many days between these dates?” usually asks for elapsed days: move forward from the start date until reaching the end date. For example, Monday to Tuesday is one day between, even though the two named dates are both part of a list of dates. If a form asks for the number of days in a period and intends to count the first and last day, it may instead expect an inclusive count.

A useful way to decide is to ask whether you are measuring time elapsed or counting dates touched:

  • Elapsed time: exclude the starting date. January 10 to January 15 is 5 days.
  • Inclusive date count: include January 10, 11, 12, 13, 14, and 15, for 6 dates.
  • Same date: the elapsed difference is 0 days. An inclusive count of that one date is 1.

This distinction comes up in travel itineraries, project schedules, event planning, and date-range reports. Follow the wording or counting rule used by the form or organization when the result has a formal purpose; inclusive and elapsed counts differ by one.

Leap Years, Months, and Calendar Rules

Months have different lengths, so a date difference cannot reliably be calculated by multiplying the number of months by 30. A calendar calculation accounts for the actual days in each month: 28, 29, 30, or 31. February has 29 days in a leap year.

In the Gregorian calendar, a year is a leap year if it is divisible by 4, except that a century year must also be divisible by 400. Thus, 2000 was a leap year, while 1900 was not. This rule matters when the date range crosses late February. For example, February 28 to March 1 is 2 elapsed days in a non-leap year and 2? In a leap year, it is also 2 elapsed days only if counting from February 28 through March 1: February 29 is crossed, making the elapsed difference 2 days. February 28 to March 2 is 3 days in a leap year and 2 in a non-leap year.

For ordinary modern dates, Gregorian calendar calculators are generally appropriate. Historical records can be more complicated because countries adopted the Gregorian calendar at different times, and older documents may use another calendar system. Check the calendar convention when calculating dates far in the past or working with archival records.

Using Results for Hours, Weeks, and Planning

A calendar-day result is not automatically a count of complete 24-hour periods between two timestamps. If you enter only dates, the calculation treats each date as a calendar day and does not know the time of day or time zone. A span from 11 p.m. one day to 1 a.m. the next crosses one calendar date boundary but lasts only two hours.

For rough conversion, divide elapsed days by 7 to get weeks and remaining days. For example, 24 days is 3 weeks and 3 days. Multiplying days by 24 gives hours only when you mean a duration of fixed 24-hour days. Local clock time can be affected by daylight-saving transitions, and a time-zone change can alter the elapsed hours between matching local times. For precise timed intervals, use full timestamps with a stated time zone rather than dates alone.

Likewise, a month is not a fixed number of days. If a task asks for “one month later,” calendar-month arithmetic is usually intended, not a fixed 30-day interval. The result can depend on the starting day and the convention used when the target month has fewer days.

Common Errors and Limits

  • Adding one automatically: this changes an elapsed-day difference into an inclusive count. Use it only when both endpoint dates are to be counted.
  • Swapping dates: end minus start is positive when the end date is later. If the dates are reversed, the signed result is negative; check the order rather than treating that as an elapsed positive span.
  • Assuming every month has 30 days: month lengths and leap days make that shortcut unreliable for calendar dates.
  • Mixing date formats: 04/05/2025 could mean April 5 or May 4, depending on the convention. Prefer a clear format such as 5 April 2025 or 2025-04-05.
  • Confusing dates with timestamps: date-only arithmetic cannot account for hours, minutes, time zones, or daylight-saving changes.

The result is a mathematical calendar difference, not an interpretation of a contract, policy, deadline, or official counting rule. Such contexts may define which days count, what happens on weekends or holidays, or whether the first day is included. Apply the relevant stated rule rather than assuming the calculator’s elapsed-day convention is the required one.

Frequently Asked Questions

Do you count the start date when calculating days between dates?
No. The usual elapsed-day difference excludes the start date. Add one only when you need an inclusive count of both the start and end dates.

How many days are between two dates in the same month?
Subtract the earlier day of the month from the later one. For example, from the 8th to the 19th is 11 elapsed days, or 12 dates if counting both endpoints.

Does a leap year change the number of days between dates?
It can when the range crosses February 29. A correct calendar calculation automatically includes the leap day.

How do I count business days instead of calendar days?
A calendar-day difference includes weekends and holidays. Business-day counts require a rule for weekends and a holiday calendar; the simple date subtraction shown here does not remove those days.

Can I use this to calculate hours between two times?
Not from dates alone. Enter complete timestamps and account for the applicable time zone when the exact number of hours matters.

Related

Formula used
in start | Start date (days from 1970-01-01) | days | 20000 | 0
in end | End date (days from 1970-01-01) | days | 20010 | 0
out days | Days between dates | days | end - start | 0
out inclusive | Days including both dates | days | end - start + 1 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.