Counting the gap between two dates is a common task: you may want to know how many days have passed since an event, or how many days remain until one. The days between dates calculator handles both cases from the same two inputs.
Enter a start date in the From field and an end date in the To field, then read the result in Time between. The calculator shows days by default and can express the same span in seconds, minutes, hours, weeks, months or years. Checking Include end date adds one day, so the count covers both endpoint dates instead of only the gap between them.
What equation does the calculator use?
The tool turns the two selected dates into one duration with this relation, taken directly from its own equation:
Here is the From date and is the To date. The include end date term is a switch with two sourced values: 1 when the checkbox is selected, with the option labeled "Include end date", and 0 when it is not. With the switch at 0 the result is the plain difference between the dates; with the switch at 1 the final day is counted too.
Which fields and units does the calculator offer?
| Element | Label | What it does | Sourced value or type |
|---|---|---|---|
| Start date | From | Choose a date from the calendar or type it in | date1, date input |
| End date | To | Choose a date from the calendar or type it in | date2, date input |
| End-date switch | checkbox | Adds the end date to the count | 1 = Include end date, 0 = not included |
| Result | Time between | Displays the duration, in days by default | time_between, numerical |
The result is not limited to days. The source lists seconds, minutes, hours, days, weeks, months and years as available units: click the day option in the Time between field to choose the unit that suits your purpose.
Worked example: 4 July to 26 July
Take the interval from the 4th of July to the 26th of July. With the end date excluded, subtract the start day from the end day:
If you select Include end date, the switch contributes 1 instead of 0:
In the calculator, choose 4 July in From and 26 July in To. Time between reads 22 days; tick Include end date and it reads 23 days. The two answers differ by exactly the one day controlled by the checkbox.
Frequently Asked Questions
Can I type a date instead of using the calendar?
Yes. Both the From and To fields accept a typed date as well as a calendar selection, according to their field hints: "Choose a date from the calendar or type it in."
How do I change the year and month in the date picker?
Use the arrow keys. The calculator's own instructions say to use them to change the year and month when selecting the start date in the From field, and the same picker is used for the To field.
Which units can the result be shown in?
The result can be expressed in seconds, minutes, hours, days, weeks, months or years. It appears in days by default, and the unit can be changed with the day option in the Time between field.
What does the Include end date checkbox change?
It switches the equation term between 1 and 0: with the box checked the last date is counted, giving 23 days for the 4 to 26 July interval, and unchecked it gives 22 days.
References
- Omni Calculator, "Days Between Dates Calculator": tool description, available output units and the date2 - date1 + include end date relation.
- Omni Calculator, "How to use our days between dates calculator": From and To calendar steps, the Time between field and the Include end date option.
- Omni Calculator, "Days Between Dates Calculator" field definitions: From, To, Include end date and Time between.