The MathBlog days between dates calculator is designed to quickly calculate how many days are between two specific dates. It allows to identify how much time has passed since a memorable event or how many days remain until a future date.
Days Between Dates Calculator
How to Use the Days Between Dates Calculator
To use this days between dates calculator, you will have to:
- Click on the calendar icon or field in the From section.
- Pick the start date of the period you’re calculating. You can use the arrows to switch between months and years.
- Now, click the calendar icon or field in the To section.
- Choose your end date.
- The Time between field displays the elapsed calendar-day difference.
- Enable Include End Date when you want to count both selected dates.
By default, the result is the elapsed calendar-day difference. To count both selected dates, enable Include End Date; this adds one day, so a single selected date counts as one day.
How to Calculate the Number of Days Between Two Dates?
While the question might seem straightforward, calculating the number of days between two dates can become more challenging as the gap between the dates increases. Let’s break it down with a few examples to make things clearer.
Editor’s Note: The examples use elapsed calendar-day differences. To count both selected dates, add one day to the result.
Same Month, Same Year
When both dates fall within the same month and year, the calculation is simple. You just subtract the earlier day from the later day. For example, if you’re looking at August 5, 2023, and August 15, 2023, the difference is:
\(15-5=10\) days apart.
Same Year, Different Months
If the dates are in the same year but different months, find each date’s day-of-year number, counting January 1 as day 1. Subtract the earlier number from the later one. Account for February 29 in a leap year.
For instance, if you want to calculate the number of days between March 10, 2023, and June 25, 2023, start by counting the days from January 1:
- January 1 through March 10 (inclusive):
\(31\) (January) \(+28\) (February) \(+10\) (March) \(=69\) days - January 1 through June 25 (inclusive):
\(31\) (January) \(+28\) (February) \(+31\) (March) \(+30\) (April) \(+31\) (May) \(+25\) (June) \(=176\) days
Now, subtract the two:
\(176-69=107\) days
Different Years
If the two dates span across different years, you’ll need to calculate the days left in the starting year, the days that have passed in the ending year, and the full years in between.
For example, let’s figure out how many days are between October 15, 2015, and February 20, 2018.
- From October 15, 2015, to December 31, 2015:
\(31\) (October) \(-15+30\) (November) \(+31\) (December) \(=77\) days - January 1 through February 20, 2018 (inclusive):
\(31\) (January) \(+20\) (February) \(=51\) days - The complete calendar years between 2016 and 2017 contribute:
\(366\) (2016, a leap year) \(+365\) (2017) \(=731\) days
Adding it all together:
\(77+51+731=859\) days. This is the elapsed calendar-day difference, excluding the starting date and including the ending date. Counting both dates would give 860 days.