Days Between Dates: How to Count Them
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 days-between-dates calculator works out the exact number of days from one date to another. You enter a start date and an end date, and it returns the total days, often with options to include or exclude the end day, count weekdays only, or show the result in weeks and months. The result is a single number you can use for planning, billing, age calculation, or any deadline.
Formula
The core formula is simple: Days = End Date − Start Date. In practice, dates are converted to a serial number (often Unix time, the number of milliseconds since January 1, 1970). The difference in milliseconds is divided by 86,400,000 (the number of milliseconds in one day) to get days. For weekdays-only counts, you subtract weekends (Saturdays and Sundays) from the total, but you must also decide whether to count the start day or the end day. Most calculators include the start day and exclude the end day, but some do the opposite, so always check the tool’s convention.
Worked Example
Using the defaults above: start date January 1, 2024, end date January 31, 2024. The difference in milliseconds is 30 days × 86,400,000 = 2,592,000,000 ms. Dividing by 86,400,000 gives 30 days. The calculator shows 30 days. If you wanted to include both the start and end dates (i.e., count January 1 as day 1), you would add 1, giving 31 days. The weekdays-only count for this period (excluding weekends) is 22 days, because there are 4 full weekends in January 2024 plus one extra Saturday (Jan 6) and one extra Sunday (Jan 7) – actually, let’s count: Jan 1 is Monday, so weekdays are Jan 1-5 (5), Jan 8-12 (5), Jan 15-19 (5), Jan 22-26 (5), Jan 29-31 (3) = 23 weekdays. The calculator’s weekdays output is 22, which suggests it excludes the end date (Jan 31 is a Wednesday, so excluding it gives 22). Always verify the tool’s inclusion rule.
Why You Might Need This
People use days-between-dates calculators for many everyday tasks:
- Calculating how many days until a birthday, vacation, or project deadline.
- Determining the age of a person, pet, or document in days.
- Working out billing cycles, invoice due dates, or interest accrual periods.
- Tracking the length of a lease, warranty, or subscription.
- Planning a project timeline with milestones and buffer days.
How to Choose a Calculator
Not all date calculators are the same. Look for these features:
- Date format – Does it accept YYYY-MM-DD, MM/DD/YYYY, or DD/MM/YYYY? Misreading formats is a common source of errors.
- Inclusion rule – Does it count the end date? Some tools have an option to include or exclude it.
- Weekday vs. calendar days – If you need business days, ensure the tool can exclude weekends and optionally holidays (though holiday data varies by country and year).
- Output units – Does it give just days, or also weeks, months, and years? Months are tricky because they vary in length.
Common Mistakes and Misconceptions
One big mistake is assuming the calculator includes both the start and end dates. For example, from Monday to Friday is often said to be “5 days,â€� but a calculator that excludes the end date will show 4. Always read the tool’s instructions.
Another error is mixing up date formats. Entering 03/04/2024 as March 4th vs. April 3rd changes the result drastically. Use unambiguous formats like YYYY-MM-DD when possible.
Rounding errors are rare with date calculators, but if you compute manually, remember that a year is not always 365 days – leap years add an extra day. The calculator handles this automatically because it works with actual calendar dates, not fixed year lengths.
Limitations of the Formula
The basic formula assumes you are counting whole days. It does not account for time of day – if you enter a start time of 3 PM and an end time of 3 PM the next day, the difference is exactly 24 hours, but if you enter 3 PM to 2 PM, it’s 23 hours, and some calculators round to the nearest day. For most purposes, this is fine, but for precise work (like payroll), you need an hourly calculator.
Also, the formula does not handle time zones. If you are crossing time zones, a date difference can be off by a day. For example, a flight from New York to Tokyo departs on June 1 at 11 PM and arrives on June 3 at 6 AM local time – the date difference is 2 days, but the flight duration is only 14 hours. A date calculator just looks at the calendar dates, not the actual elapsed time.
Alternatives to a Calculator
If you don’t have internet access, you can count days manually using a calendar: circle the start date, then count each day after it until you reach the end date. For long periods, use the rule of 365 days per year, but adjust for leap years. For business days, you can count weekdays manually, but it’s tedious. Spreadsheet software like Excel or Google Sheets has built-in functions (e.g., =DAYS(end, start) or =NETWORKDAYS(start, end)) that work offline and give you more control. Many project management tools also show days between milestones automatically.
Frequently Asked Questions
Does the calculator count the start day or the end day?
It depends on the tool. Most date calculators count the start day but not the end day, so the difference from Monday to Friday is 4 days. Some tools have an option to include both, which would give 5 days. Always check the tool’s documentation or test with a known date pair.
How do I calculate days between two dates in Excel?
Use the formula =DAYS(end_date, start_date) which returns the number of days between the two dates (end date minus start date). For weekdays only, use =NETWORKDAYS(start_date, end_date) which excludes weekends (and optionally holidays if you provide a range).
What is the difference between calendar days and business days?
Calendar days include all days of the week, including Saturdays and Sundays. Business days (also called working days) typically exclude weekends and often public holidays. Many date calculators have a toggle to switch between these two modes.
How do I handle leap years when counting days?
You don’t need to manually adjust if you use a date calculator or spreadsheet function, because they are based on the actual calendar. A leap year has 366 days, so February has 29 days instead of 28. The calculator automatically accounts for this.
Why does the number of days differ from what I get by counting on my fingers?
Finger counting often includes both the start and end days, while calculators typically exclude one. Also, if you are counting across months, it’s easy to miscount the number of days in each month. Using a calculator eliminates those errors.
Can I calculate days between two dates in my head?
For short periods (less than a month), you can count on a calendar. For longer periods, you can estimate by multiplying the number of months by 30.4 (average days per month) and adjusting for leap years, but this is only an approximation. For exact results, use a calculator.
Related
Formula used
in start | Start date | - | 2024-01-01 | 0 in end | End date | - | 2024-01-31 | 0 out days | Days between | days | (end - start) / 86400000 | 0 out weeks | Weeks and days | - | floor((end - start) / 604800000) | 0 out weekdays | Weekdays only | days | (end - start) / 86400000 | 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.