ThisCalculator

Date and time

Calculate Days Between Dates: Formula and Examples

Updated · Standard formula, shown below

Days between dates 10 days
Start date (days from 1 Jan 0001)
738886 day
You entered
End date (days from 1 Jan 0001)
738896 day
You entered

Calculate Days Between Dates: Formula and Examples

To calculate the days between two dates, enter the start date and end date; the calculator returns the elapsed number of days. It counts the difference between the dates, so the start date itself is not included in the result.

Formula

Days between dates = end date − start date. In the calculator, start and end are each entered as a whole-number day index: the number of days since 1 January, year 1, in the Gregorian calendar. The output, days, is an elapsed duration in days. A date-index converter would translate calendar dates into these numbers; the inputs shown here are the underlying day indices, not dates typed in a calendar field.

For ordinary date arithmetic, the same rule is expressed as later calendar date − earlier calendar date. The day index increases by one for each calendar day, including leap days, so subtracting the indices automatically accounts for month lengths and leap years. If the dates are entered in reverse order, the result is negative.

Worked Example

The defaults are start = 738886 and end = 738896. Subtract the start index from the end index:

  • Days between = 738896 − 738886
  • Days between = 10 days

This means ten full date-to-date day steps separate the two dates. The index values correspond to 1 January 2024 and 11 January 2024, respectively.

How Date Differences Work

A calendar date is a label for a day, while a date difference is a duration. If a period starts on Monday and ends on Tuesday, one day has elapsed even though two date labels are involved. This is why “days between” usually excludes the start date: it measures the steps from one date to the other.

Calendar subtraction is not the same as subtracting the day numbers printed on a calendar. For example, going from 31 January to 1 February is one day, not a negative 30 or a month-long interval. A correct calculation accounts for the full calendar, including the number of days in each month and leap years. In the Gregorian calendar, leap years generally occur every four years, except century years that are not divisible by 400.

The calculator specification uses day indices because its inputs are numeric. When using a date-based tool, enter the actual calendar dates and let it convert them; do not mistake an index such as 738886 for a year, month, or day.

Inclusive Counting and Date Ranges

Sometimes a person wants to count every named date in a range rather than measure elapsed time. For an inclusive count, add one to the usual difference when the start and end dates are both included. For example, 1 January through 11 January includes 11 calendar dates, even though only 10 days elapse from the start of 1 January to the start of 11 January.

  • Elapsed days: end date minus start date. Use this for durations and date offsets.
  • Inclusive calendar dates: end date minus start date, plus one, if both endpoints count.
  • Exclusive endpoints: the ordinary difference gives elapsed day steps; it does not count either date as a complete day of activity.

Check the convention before using a result for a schedule, form, or project. Terms such as “days remaining,” “nights,” and “business days” can use different rules. A stay from Monday to Friday is typically four nights, although five date labels appear if both arrival and departure dates are listed.

When to Use a Day Difference

Day differences help with general planning: measuring the length of a project, counting days until an event, or checking how long separates two milestones. They are useful when every calendar day counts. If only weekdays count, a plain subtraction is not enough; weekends and any relevant holidays must be excluded according to the intended calendar.

For an event later in the same year, the arithmetic may look simple, but crossing a month boundary or year boundary is a common reason to use a calculator. For instance, a period spanning February in a leap year includes 29 February. A correct Gregorian date calculation handles that extra day without needing a manual adjustment.

Date differences also do not necessarily represent exact elapsed hours. A calendar-day difference compares dates, not timestamps. If a period begins at 11 p.m. and ends at 1 a.m. two dates later, the calendar difference is two days, while the elapsed time is 26 hours. For precise durations, include times and account for the applicable time zone.

Common Errors and Limitations

  • Counting both endpoints by mistake: decide whether the question asks for elapsed days or an inclusive count.
  • Using the wrong order: subtract the earlier date from the later one for a positive result.
  • Ignoring the calendar system: this method assumes Gregorian dates. Historical dates may be recorded under another calendar or a local calendar transition.
  • Confusing calendar days with business days: weekends and holidays require separate rules.
  • Mixing dates and timestamps: daylight-saving changes and time zones can affect exact hours, but not the simple count of calendar date boundaries.

For dates far in the past, the date shown in a historical record may follow the calendar used locally at the time. The Gregorian calendar was introduced at different times in different places, so an online calculator applying it proleptically may not match a historical source. For modern everyday dates, Gregorian date arithmetic is the usual convention.

Frequently Asked Questions

Does “days between” include the start date?
No. The usual elapsed-day difference excludes the start date. Add one only when you intentionally want an inclusive count that includes both the start and end dates.

How do I calculate days between dates manually?
Count the elapsed calendar days from the earlier date to the later date, carrying across month and year boundaries. A reliable date calculator performs that subtraction while accounting for month lengths and leap years.

Are weekends included in the result?
Yes. Ordinary calendar-day differences include Saturdays, Sundays, and holidays. To count business days, use a method that excludes the relevant weekends and holidays.

Does the calculation account for leap years?
It should when it uses Gregorian calendar dates or correctly prepared day indices. Leap days are part of the calendar and contribute one day when a date range crosses 29 February.

Why can a day difference differ from elapsed hours?
A date difference compares calendar dates, not exact times. Time of day, time zone, and daylight-saving changes can make the number of elapsed hours differ from 24 times the calendar-day result.

Related

Formula used
in start | Start date (days from 1 Jan 0001) | day | 738886 | 0
in end | End date (days from 1 Jan 0001) | day | 738896 | 0
out days | Days between dates | days | end - start | 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.