Date Calculator Number of Days: How to Count
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.
A date calculator for number of days works out the exact span between two calendar dates, or the date you land on after adding or subtracting a set number of days. You enter a start date and either an end date or a day count, and it returns the difference in days (or the new date) instantly. This page explains the math behind that calculation, how to use it correctly, and the common traps that lead to wrong answers.
Formula
The core formula for the number of days between two dates is simply:
Days = End date − Start date
Where each date is first converted to a serial day number (the count of days since a fixed reference point, such as 1900-01-01 in many spreadsheet systems). The subtraction gives the total number of 24-hour periods between the two dates. If you want the result as weeks and leftover days, use:
Whole weeks = floor(Days ÷ 7), and remaining days = Days mod 7.
For adding days to a date, the formula is the reverse: New date = Start date + N days, where N is the number of days you add. The calculator handles the calendar arithmetic internally, including month lengths and leap years.
Worked Example
Using the default values from the calculator above: start date 2024-01-15, end date 2024-03-20.
- Count the days from January 15 to January 31: 16 days (Jan 15 to Jan 31 inclusive of the start? No—exclusive, so 16 days).
- Add all of February 2024: 29 days (2024 is a leap year).
- Add the days in March up to March 20: 20 days.
- Total = 16 + 29 + 20 = 65 days.
The calculator returns 65 days, which equals 9 weeks and 2 days. The formula gives the same result because it converts both dates to serial numbers and subtracts.
Why You Might Need This
People use a date calculator for dozens of everyday tasks:
- Counting days until a deadline, exam, or event
- Calculating how many days since a past date (e.g., a birthday or anniversary)
- Figuring out a due date for a project or a legal notice
- Planning travel itineraries or shipping timelines
- Checking how many days of interest accrue between two payments
The result is always a whole number of days, but you may need to interpret it differently depending on context. For example, if you start a 10-day trial on March 1, the trial ends on March 10 (inclusive counting) or March 11 (exclusive counting). Always clarify whether you count the start day.
How to Choose the Right Method
There are two common ways to count days, and they give different answers:
- Exclusive (most common): Count the number of 24-hour periods between the dates. From Jan 1 to Jan 2 is 1 day. This is what the calculator above does.
- Inclusive: Count both the start and end dates. From Jan 1 to Jan 2 is 2 days. This is used in legal contexts or when counting “days of service.�
If you need an inclusive count, simply add 1 to the exclusive result. For example, a rental from Jan 1 to Jan 5 is 4 nights (exclusive) but 5 calendar days (inclusive).
Also decide whether you need calendar days or business days. Business days exclude weekends and often holidays. That requires a separate calculation and is not what this calculator does.
Common Mistakes and Misconceptions
One frequent error is mixing up the order of dates. If you enter the later date as the start, you get a negative number. Most calculators expect the earlier date first, but you can take the absolute value if you only care about the span.
Another trap is forgetting leap years. February 29 exists every four years, so the number of days between Feb 28, 2023, and Feb 28, 2024, is 366 days, not 365. The calculator handles this automatically, but manual counting often misses it.
A third mistake is assuming every month has 30 days. That works for rough estimates but is wrong for exact counts. For instance, from Jan 15 to Feb 15 is 31 days, not 30.
Finally, be careful with time-of-day. If you enter dates without times, the calculator assumes midnight. If you need to include hours, you would need a different tool.
Limits of the Formula
The simple subtraction formula works perfectly for the Gregorian calendar, which is the standard in most of the world. However, it does not account for:
- Time zones – a date in one time zone may be a different date in another.
- Daylight saving time – adding 24 hours to a local time can shift the clock by an hour.
- Historical calendar changes – before 1582 (or later in some countries), the Julian calendar was used.
- Business-day calculations – weekends and holidays are not excluded.
For most personal and professional uses, the Gregorian calendar difference is exactly what you need. If you are working with contracts or legal deadlines, check whether the jurisdiction uses inclusive counting or business days.
How to Read the Result
The output “65 days� means exactly 65 full 24-hour periods from midnight on the start date to midnight on the end date. If you want to express it as weeks, divide by 7: 65 ÷ 7 = 9 weeks and 2 days. Many calculators also show the result in months and years, but those are approximate because months vary in length. For precise planning, stick with days or weeks.
If you add days to a date, the result is a calendar date. For example, adding 90 days to Jan 15, 2024, gives April 14, 2024 (since 2024 is a leap year, Jan 15 + 90 = April 14). Always double-check the month length when doing this manually.
Frequently Asked Questions
How do I count days between two dates manually?
Write the start and end dates, then count the days in each month between them. For example, from March 10 to April 5: March has 31 days, so from March 10 to March 31 is 21 days, plus 5 days in April = 26 days. Remember to adjust for leap years if February is involved.
What is the difference between inclusive and exclusive days?
Exclusive days count the number of 24-hour periods between dates (Jan 1 to Jan 2 = 1 day). Inclusive days count both the start and end dates (Jan 1 to Jan 2 = 2 days). Add 1 to the exclusive result to get the inclusive count.
Why does my spreadsheet give a different number of days?
Spreadsheets often use a serial date system that starts at a specific date (like 1900-01-01) and may have a bug with 1900 being treated as a leap year. Also, check whether your formula is subtracting dates or using a function like DATEDIF. Differences usually come from inclusive vs exclusive counting.
How many days are in a year on average?
The average length of a Gregorian calendar year is 365.2425 days. That’s why we have leap years every four years, except for century years not divisible by 400. For rough estimates, 365 days is usually fine.
Can I use this calculator to find a date 90 days from today?
Yes. Enter today’s date as the start date and 90 as the number of days to add (if the calculator supports that). If it only finds the difference between two dates, you would need to manually set the end date and adjust until the result shows 90 days.
Does the calculator include the end date?
No. The result is the number of full days between the two dates, not counting the end day. If you need to include the end day, add 1 to the result.
Related
Formula used
in start | Start date | - | 2024-01-15 | 0 in end | End date | - | 2024-03-20 | 0 out days | Number of days | days | end - start | 0 out weeks | Weeks and days | - | floor(days / 7) | 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.