Skip to content

Number of Days Calculator - Calculate Days Between Dates

A number of days calculator that finds the days between two dates or adds days, weeks, months, or years to a date, accounting for leap years and month lengths.

Number of Days Calculator

Loading calculator...
📚

Documentation

What is a number of days calculator?

A number of days calculator finds how many days lie between two dates. It can also do the opposite: start from one date and add a number of days, weeks, months, or years to find a later date. Both jobs use calendar arithmetic, not clock time, so the result does not change with time zone or daylight saving time.

How to calculate the number of days between two dates

To find the number of days between two dates, count how many days apart they are on the calendar. The formula is:

1days between = |end date's day count − start date's day count|
2

Each date's "day count" is its position in an unbroken sequence of calendar days. Subtracting one from the other, then taking the absolute value, gives the number of days between them. This works in either order: the calculator always returns a positive number, so it does not matter which date is entered first.

The calculation accounts for two things that make dates tricky to count by hand:

  • Varying month lengths. Months run from 28 to 31 days, so the gap between two dates depends on which months fall in between.
  • Leap years. Under the Gregorian calendar, a year is a leap year if it divides evenly by 4. Century years are the exception: they are leap years only if they also divide evenly by 400. So 2024 is a leap year, but 1900 was not and 2000 was.

Worked example

From January 1, 2024 to February 1, 2024: January has 31 days, so the calculator returns 31 days.

How to calculate a date after a period

The second mode starts from a date and moves forward by a chosen number of days, weeks, months, or years.

  • Days: the date moves forward that many calendar days.
  • Weeks: the date moves forward that many weeks, counted as seven days each.
  • Months: the date moves forward that many months, keeping the same day of the month. If the target month is shorter and does not have that day, the result falls back to the last day of that month.
  • Years: the date moves forward that many years, keeping the same month and day. If the result would be February 29 in a year that is not a leap year, it falls back to February 28.

The period must be a whole number of at least 1. The calculator only moves forward from the start date; it does not subtract a period to find an earlier date.

Worked examples

January 31, 2024, plus 1 month. February does not have a 31st day, so the result falls back to the last day of February. Because 2024 is a leap year, that is February 29, 2024.

February 29, 2024, plus 1 year. One year later is February 2025, which is not a leap year and has no 29th day. The result falls back to the last day of February 2025: February 28, 2025.

Frequently asked questions

How do you calculate the number of days between two dates?

Subtract one date's position in the calendar from the other's and take the absolute value. The result is a whole number of days that ignores the time of day, so it gives the same answer no matter what time either date was entered.

Does the calculator account for leap years?

Yes. It follows the Gregorian leap-year rule: a year divisible by 4 is a leap year, unless it is a century year, in which case it must also be divisible by 400. February has 29 days in a leap year and 28 days otherwise.

Can I calculate a date in the past by entering a negative number of days?

No. The "date after period" mode only adds a period forward from the start date; the period must be 1 or more. To measure back to an earlier date, use the "days between dates" mode with the earlier date as one of the two inputs.

What happens if adding a month or year lands on a day that does not exist, like February 31?

The result falls back to the last valid day of that month. Adding 1 month to January 31 gives February 28 in a normal year or February 29 in a leap year, because February never has 31 days.

Does time zone or daylight saving time affect the result?

No. Both calculations work entirely with calendar dates rather than moments in time, so the result is the same regardless of the time zone or clock settings of the device used.

Does the calculator count business days only, or every day?

Every calendar day, including weekends and holidays. A dedicated business-day calculator is needed to exclude weekends and holidays from the count.

Does the calculator handle dates before the Gregorian calendar was adopted in 1582?

It applies today's Gregorian calendar rules to any date entered, including dates before 1582. Many countries used the Julian calendar before that year, so results for historical dates may not match the calendar system in use at the time.