ThisCalculator

Date and time

Calendar Calculator: Add Days Between Dates

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Calendar Calculator: Add Days Between Dates

This calculator works out the number of days between two dates, or adds or subtracts a set number of days to a starting date. You enter a start date, an end date (or a number of days), and you get the exact day count, plus the resulting date when adding or subtracting. It uses the standard Gregorian calendar, the same one used for everyday civil dates in most of the world.

Formula

The core operation is simple date arithmetic on a proleptic Gregorian calendar. Internally, each date is converted to a serial day number (the number of days since a fixed epoch, e.g., 1900-01-01). Then:

  • Days between dates = serial(end date) − serial(start date). The result is an integer; a positive value means the end date is later.
  • Date after adding days = serial(start date) + number of days. The result is a calendar date.

Variables:

  • Start date – the initial date (YYYY-MM-DD).
  • End date – the later date for the day count (YYYY-MM-DD).
  • Days to add/subtract – an integer; positive adds, negative subtracts.

All dates are treated as local calendar dates, not timestamps, so time zones and daylight saving time do not affect the result.

Worked Example

Using the default values: start date 2024-01-01, end date 2024-12-31, days to add = 90.

  1. Convert 2024-01-01 to serial number: it is day 1 of 2024.
  2. Convert 2024-12-31 to serial number: it is day 366 of 2024 (2024 is a leap year).
  3. Days between = 366 − 1 = 365 days.
  4. Add 90 days to 2024-01-01: January has 31 days, so 31 days get you to Feb 1 (day 31), 60 days to Mar 1 (day 60), 90 days to Mar 31 (day 90). The result is 2024-03-31.

The calculator shows 365 days and 2024-03-31, matching the manual calculation.

How Date Difference Calculations Work

Most date calculators use a standard algorithm: convert each date to a serial number using a formula that accounts for the varying lengths of months and leap years. The difference is then a simple subtraction. This is the same method used in spreadsheets and programming languages. The key is that the Gregorian calendar has a 400-year cycle of leap years: a year is a leap year if it is divisible by 4, except if it is divisible by 100 but not by 400. For example, 2000 was a leap year, 1900 was not, and 2100 will not be. The calculator applies this rule for all dates, including those before 1582 (the proleptic Gregorian calendar).

How to Use the Calculator

Enter a start date and either an end date or a number of days. The calculator gives you:

  • Days between dates – the total number of 24-hour periods between the two dates, counting the start date as day 0.
  • Date after adding days – the resulting date when you add the specified number of days to the start date.

For example, to find out how many days until a project deadline, enter today’s date as the start and the deadline as the end. To find a date 45 days from now, enter today’s date and 45 in the days field. The calculator handles negative day values, so you can also subtract days to find a past date.

Common Mistakes and Misconceptions

One frequent error is confusing “days between� with “days including both endpoints.� If you want to know how many days are in a period that includes both the start and end dates, add 1 to the result. For example, the days between Jan 1 and Jan 2 is 1, but the period spans 2 calendar days. Another mistake is mixing date formats – always use YYYY-MM-DD to avoid ambiguity. Also, remember that adding 1 month is not the same as adding 30 days; this calculator works in exact days, not months. For month-based calculations, you need a different tool that handles month-end rollover (e.g., Jan 31 + 1 month = Feb 28 or Feb 29).

Limitations of the Formula

The calculator assumes the proleptic Gregorian calendar, which is the standard for most date arithmetic. It does not account for historical calendar changes (e.g., the Julian calendar before 1582 in some countries). It also treats all days as equal 24-hour periods, ignoring daylight saving time shifts. For most practical purposes – project planning, age calculation, countdowns – this is perfectly accurate. However, if you need to calculate elapsed time in hours or minutes across time zones, you would need a different tool that includes time-of-day and time zone offsets.

Alternatives to a Date Calculator

If you need more than just day counts, consider these alternatives:

  • Spreadsheet software (e.g., Excel, Google Sheets) has built-in functions like DATEDIF or simple subtraction of date cells.
  • Programming languages (Python, JavaScript) have date libraries that handle complex date math.
  • Calendar apps often show days between events, but usually only for events you have entered.
  • Online calculators with month/year options – some let you add months or years, which is different from adding days.

For simple day counts, this calculator is the fastest and most straightforward option.

Frequently Asked Questions

How do I count days between two dates including the start date?

If you want to include the start date in the count (e.g., “how many days are in this period?�), add 1 to the result. For example, days between Jan 1 and Jan 3 is 2, but the period includes 3 calendar days (Jan 1, 2, 3). Most calculators, including this one, give the difference, not the inclusive count.

What is the difference between adding days and adding months?

Adding days is straightforward: each day is exactly 24 hours. Adding months is variable because months have different lengths. For example, adding 1 month to Jan 31 gives Feb 28 (or 29 in a leap year), not Feb 31. This calculator only adds days; for month arithmetic, use a dedicated month calculator.

Does this calculator account for leap years?

Yes, it uses the Gregorian leap year rule. A year is a leap year if divisible by 4, except if divisible by 100 but not by 400. So 2024 is a leap year, 1900 is not, and 2000 is. The day count between Jan 1, 2024 and Jan 1, 2025 is 366 days.

Why does the calculator give a different result than my phone’s calendar?

Most calendar apps show the number of days between two dates excluding the start date, which matches this calculator. However, some apps or websites may include the start day or use a different counting method. Always check whether the result says “days between� or “days including.� This calculator clearly states it gives the difference.

Can I calculate days between two dates in different time zones?

This calculator treats dates as calendar dates, not moments in time. If you need to account for time zones, you must specify the exact times and use a time zone converter. For most purposes, the calendar day difference is sufficient.

What is the earliest date I can enter?

You can enter any date, but the calculator uses the proleptic Gregorian calendar, which extends the Gregorian rules backward before 1582. For dates before that, the result may not match historical records because different countries used different calendars. For modern dates, it is accurate.

Related

Formula used
in d1 | Start date | - | 2024-01-01 | 0
in d2 | End date | - | 2024-12-31 | 0
in n | Days to add/subtract | days | 90 | 0
out diff | Days between dates | days | d2 - d1 | 0
out result | Date after adding days | - | d1 + n | 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.