A days between dates calculator tells you the exact number of days from one calendar date to another. You enter a start date and an end date, and it returns the total days, often with options for weeks, months, or business days. The calculation is straightforward arithmetic on the calendar, but the details matter once you start counting weekends, holidays, or partial days.
Formula
The core formula treats each date as a point on a timeline measured in milliseconds since a fixed reference (January 1, 1970, in most programming languages). The difference between two dates is simply:
Days = (End Date − Start Date) ÷ 86,400,000
where 86,400,000 is the number of milliseconds in one day (24 hours × 60 minutes × 60 seconds × 1000 milliseconds). The result is rounded down (floor) to a whole number because you want complete 24-hour periods, not partial days.
For weeks, divide by 604,800,000 (7 days × 86,400,000). For business days, the formula above subtracts two days for every full weekend block, which works correctly when the start and end are both weekdays; otherwise, you need a more careful adjustment.
Worked Example
Using the defaults from the calculator: start date January 1, 2024, end date December 31, 2024.
- Count the days in each month from January through December: 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 = 366 days (2024 is a leap year).
- Subtract the start day: 366 − 1 = 365 days from January 1 to December 31.
- Weeks: 365 ÷ 7 = 52.14, so 52 full weeks.
- Business days: 365 total days − (2 × 52 weekend days) = 365 − 104 = 261 business days (assuming no holidays).
The calculator returns 365 days, 52 weeks, and 261 business days, matching the manual count.
Why the Start and End Dates Matter
The biggest source of confusion is whether the start date counts as day zero or day one. If you book a hotel on June 1 and check out June 3, that is two nights, but the calendar shows three dates. Most date calculators count the difference (June 3 − June 1 = 2 days), which matches the number of nights. If you want to include both the start and end dates as full days, add 1 to the result.
For example, a project running from Monday to Friday is 4 days by difference but 5 working days if you count both endpoints. Always check which convention your calculator uses before relying on it for deadlines or billing.
Leap Years and Month Lengths
Leap years add a day to February every four years, except on century years not divisible by 400. So 2000 was a leap year, but 1900 and 2100 are not. This affects any date span that crosses February 29. A span from February 1 to March 1 is 29 days in a leap year and 28 days otherwise. The calculator handles this automatically because it works with actual calendar dates, not fixed 30-day months.
Month-based calculations are trickier. “One month from January 31” is ambiguous: some tools return February 28 or 29, others return March 2 or 3. If you need month precision, use a calendar that clamps to the last day of the month rather than adding a fixed 30.44 days.
Business Days and Holidays
Counting business days (Monday through Friday) is common for delivery estimates and contract deadlines. The simple formula subtracts weekends, but it does not account for public holidays, which vary by country, state, and even city. For example, the U.S. has 11 federal holidays, but not all employers observe all of them, and many states add their own. To get an accurate business-day count that excludes holidays, you need a holiday calendar for the specific jurisdiction, which is beyond what a generic calculator can do.
If you only need weekdays, the formula works. If you need holidays excluded, you must supply the list yourself or use a specialized service that maintains holiday tables.
Common Mistakes and Edge Cases
- Time zone errors: If you enter a date without a time, the calculator may assume midnight UTC, but your local time zone could shift the date by a day. Always verify the time zone setting.
- Inclusive vs. exclusive: As noted, decide whether the end date counts. A due date of “3 days from today” usually means today + 3, not today + 2.
- Daylight saving time: On the days clocks change, a 24-hour period may be 23 or 25 hours long. Most date calculators ignore this and use calendar days, which is correct for dates but wrong for elapsed hours.
- Negative results: If the end date is before the start date, the difference is negative. Some calculators reject this; others return a negative number. Decide which behavior you need.
- Rounding: A span of 1.5 days rounds down to 1 day if you floor, but up to 2 if you round. For deadlines, flooring is safer.
Alternatives: Manual Counting and Spreadsheets
You can count days manually using a calendar, but it is error-prone for spans over a few weeks. Spreadsheets handle this natively: in Excel or Google Sheets, simply subtract two date cells (e.g., =B1-A1) and format the result as a number. The NETWORKDAYS function in Excel counts business days, and you can add a holiday range as a third argument. For quick mental math, remember that a year is about 365.25 days, so a span of 4 years is roughly 1,461 days, but always verify with a calculator for exact dates.
Frequently Asked Questions
Does the calculator include both the start and end dates?
No. It returns the difference, so June 1 to June 3 gives 2 days. If you want to count both endpoints as full days, add 1 to the result. This is the most common source of off-by-one errors.
How do I count business days excluding holidays?
The built-in formula only removes weekends. To exclude holidays, you need to provide a list of holiday dates for your region. Many spreadsheet tools accept a holiday range; standalone calculators often do not. For legal deadlines, always confirm with the relevant authority.
What is the difference between calendar days and elapsed days?
Calendar days count each date change at midnight, regardless of time of day. Elapsed days measure actual 24-hour periods, which can be affected by daylight saving time. For most date-difference purposes, calendar days are what you want.
Why does February make the count different?
February has 28 days in a common year and 29 in a leap year. Any span crossing February 29 changes by one day. The calculator uses the real calendar, so it automatically accounts for this; a manual estimate of “30 days per month” will be off.
Can I calculate days between dates in different time zones?
Yes, but the result depends on which time zone you treat as “today.” If you enter dates without times, the calculator assumes midnight in your local zone. For exact elapsed time across zones, include the time of day and specify the zone for each date.
What is the maximum range this calculator supports?
The limits are set from January 1, 1900 to December 31, 2100. That covers nearly all practical uses, including birth dates, historical events, and long-term planning. For dates outside that range, use a spreadsheet or a specialized astronomical calculator.
Related
Formula used
in start | Start date | - | 2024-01-01 | 1900-01-01 | 2100-12-31 in end | End date | - | 2024-12-31 | 1900-01-01 | 2100-12-31 out days | Days between | days | floor((end - start) / 86400000) | 0 out weeks | Weeks | weeks | floor((end - start) / 604800000) | 1 out business | Business days (Mon-Fri) | days | floor((end - start) / 86400000) - 2 * floor((end - start) / 172800000) | 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.
- Day of Year Number: How to Find It74
- Days Left in Year: Countdown & How to Calculate
- D&D What Are Days? In-Game Time Explained168 h
- Square Root of a Complex Number Explained
- Lease Years Remaining Calculator87.00 years
- Bank Holidays UK Remaining This Year66