ThisCalculator

Date and time

Date Interval Calculator: How to Count Days

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.

Date Interval Calculator: How to Count Days

A date interval calculator works out the exact span between two dates—days, weeks, months, or years—and can also add or subtract a set amount of time to a given date. You enter a start date and an end date (or a start date and a duration), and it returns the precise interval, accounting for leap years and varying month lengths. This is the tool to use when you need to know “how many days until,� “how long ago,� or “what date is 90 days from now.�

Formula

The core calculation is simple subtraction: Interval = End Date − Start Date. The result is a number of days, which you can convert to weeks by dividing by 7, or to approximate months by dividing by the average month length of 30.4375 days (365.25 days per year ÷ 12 months).

  • Start Date – the earlier date in the interval (format: YYYY-MM-DD)
  • End Date – the later date (format: YYYY-MM-DD)
  • Days – the total number of elapsed days (the difference in days)
  • Weeks – days ÷ 7, including partial weeks (e.g., 10 days = 1.43 weeks)
  • Months – days ÷ 30.4375, an average that smooths over leap years and month length variations

This method treats dates as points on a timeline. The day count is inclusive of the start date but exclusive of the end date; for example, from January 1 to January 2 is 1 day, not 2.

Worked Example

Using the defaults from the calculator: start date 2024-01-01 and end date 2024-03-15.

  1. Convert both dates to a day count (e.g., using a serial day number). January 1, 2024 is day 1; March 15, 2024 is day 75 (since 2024 is a leap year, February has 29 days: 31 (Jan) + 29 (Feb) + 15 = 75).
  2. Subtract: 75 − 1 = 74 days.
  3. Weeks: 74 ÷ 7 = 10.57 weeks (rounded to 2 decimals).
  4. Months: 74 ÷ 30.4375 = 2.43 months.

The calculator shows 74 days as the headline answer, with 10.57 weeks and 2.43 months as conversions.

Why Date Intervals Matter

Date intervals are used in nearly every field that tracks time: project planning, billing cycles, shipping deadlines, warranty periods, and personal milestones. A reliable interval calculator removes the mental load of counting days across months with different lengths and leap years. For example, the gap from February 1 to March 1 is 29 days in a leap year, but 28 in a common year—a difference that matters for payroll or interest calculations.

Most modern calculators use a standard algorithm called the “difference in days� method, which converts each date to a serial number (like the Julian day number) and subtracts. This inherently handles leap years and month lengths correctly, as long as the input dates are valid.

How to Choose a Date Interval Calculator

Not all date calculators are the same. Consider what you need:

  • Simple day count – for most purposes, a basic “days betweenâ€� calculator suffices.
  • Business days – if you need to exclude weekends and holidays, look for a calculator that lets you define which days are non-working.
  • Add/subtract duration – some calculators let you add “3 monthsâ€� or “45 daysâ€� to a date, which is useful for deadlines.
  • Age calculation – these often show years, months, and days separately, which is more human-readable than a raw day count.

For most needs, a simple tool like the one above is enough. If you need business days, you’ll need a separate calculator that lets you specify holidays—those are not part of pure date math.

Common Mistakes and Misconceptions

A frequent error is confusing inclusive and exclusive counting. If you start a task on Monday and finish on Wednesday, some people say that’s 3 days (Mon, Tue, Wed), but the actual elapsed time is 2 days. Most calculators return the elapsed time, not the number of calendar days touched.

Another mistake is mixing up date formats. The ISO standard (YYYY-MM-DD) is unambiguous, but many people use MM/DD/YYYY or DD/MM/YYYY, which can swap the day and month. Always check your input format before relying on the result.

Rounding is also a trap. Converting days to months is not an exact science because months vary from 28 to 31 days. The average of 30.4375 days is a good approximation, but if you need “3 months from March 31,� the result can be ambiguous—some calculators add 3 months to the month number and then clamp the day to the last valid day (June 30), while others simply add 91 days. Know which behavior you need.

Limitations of the Formula

The simple subtraction method assumes every day has 24 hours and ignores time zones and daylight saving time. If you need to account for the exact time of day (e.g., “from 9 AM on March 1 to 5 PM on March 3�), you’ll need a calculator that accepts times and computes hours, not just dates.

Also, the “months� conversion is an average. If you want the exact number of calendar months between two dates (like “from January 15 to March 15 is exactly 2 months�), you need a different algorithm that compares year and month components, not just day counts. The calculator above gives an approximate months figure, which is fine for most planning but not for legal or contractual definitions of “months.�

Practical Use Cases

People use date interval calculators for a wide range of everyday tasks:

  • Project deadlines – “I have 45 days to submit this report; what’s the due date?â€�
  • Billing and subscriptions – “How many days are in this billing cycle?â€�
  • Travel planning – “How many nights between check-in and check-out?â€�
  • Fitness and habit tracking – “How many days have I been exercising?â€�
  • Historical research – “How many days between two historical events?â€�

For any of these, the calculator gives a quick, accurate answer without manual counting.

Frequently Asked Questions

How do I count days between two dates including both?

Most calculators exclude the start date and include the end date, giving the elapsed time. To include both days, add 1 to the result. For example, from Monday to Wednesday is 2 days elapsed, but 3 calendar days if you count both endpoints.

What is the best way to calculate days until a deadline?

Enter today’s date as the start date and the deadline as the end date. The result is the number of days you have left. If the deadline is at the end of the day, you might want to add 1 to account for the remainder of today.

How do I add 90 days to a date?

Use a calculator with an “add duration� feature. Alternatively, you can use the day-count method: find the serial day number of your date, add 90, and convert back. This calculator doesn’t do that directly, but many online tools do.

Why do some calculators show 1 day difference when dates are a day apart?

That’s correct—the difference between January 1 and January 2 is 1 day. If you expected 2, you’re counting both endpoints. Always check the calculator’s documentation for its counting convention.

Can I calculate the number of weeks and days separately?

Yes. Divide the total days by 7 to get weeks, and the remainder is the extra days. For example, 10 days = 1 week and 3 days. Some calculators show this breakdown, but the one above gives weeks as a decimal.

Does the calculator account for leap years?

Yes, the day-count method inherently includes leap days. For example, from February 1, 2024 to March 1, 2024 is 29 days because 2024 is a leap year. The serial day number system automatically adds the extra day.

Related

Formula used
in start | Start date | yyyy-mm-dd | 2024-01-01 | 0
in end | End date | yyyy-mm-dd | 2024-03-15 | 0
out days | Days between | days | (end - start) | 0
out weeks | Weeks (incl. partial) | weeks | (end - start) / 7 | 2
out months | Approx. months | months | (end - start) / 30.4375 | 2

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.