When you ask a calculator how many days lie between two dates, the answer depends on a small convention: does the last day count? The date to date tool exposes that convention as an "Include end date" checkbox, wired to a single input named choice. The option is one of the four steps in the tool's own instructions, yet it changes the number you get.
The include end date checkbox decides whether the final day is part of the count. It sets the choice input to 1 when checked and 0 when left at its default, and the calculator adds that value to the plain date subtraction: result = (end date - start date) + choice. The same two dates therefore produce counts one apart.
The option list in the source pairs each setting with the value it feeds into the formula:
| Setting | Stored value | Effect on the base result |
|---|---|---|
| Include end date | 1 | Adds 1 to the plain difference |
| Default option, no label | 0 | Leaves the plain difference unchanged |
What does the end-date option change?
It does not change the dates you entered and it does not change the unit. It only adds its stored 0 or 1 to the result of the subtraction. With value 0, the calculator reports the simple interval between the two dates. With value 1, one is added, so the last date is counted as part of the span. The source's dataset names the option "includeEndDate" and gives the checked option the value 1; the default, unnamed option carries value 0. That is why the two settings differ by exactly one in the output field.
Where do I set it in the calculator?
In the source's four-step workflow, the checkbox comes last. You choose the start date, choose the end date, adjust the units, and then check the box "include end date" to choose whether to include the end date in your count. Because the option is applied after the dates and units are set, you can toggle it at any time and compare the two counts for the same pair of dates without re-entering anything.
Worked example: counting 10 May to 12 May
Suppose the start date is 10 May and the end date is 12 May.
- Default, choice = 0: result = (12 May - 10 May) + 0 = 2.
- Include end date checked, choice = 1: result = (12 May - 10 May) + 1 = 3.
The first figure is the plain interval; the second counts both the starting and the closing day of the range. If you switch the displayed unit, the same choice value is still added to the base result, so the one-step difference remains. The other fields of the calculator - result seconds, heartbeat, dog years, hotdog and plane - are then multiplied from whichever result you produced.
Frequently Asked Questions
Is the end date included by default?
No. The default option in the source has value 0 and no label; value 1 is tied specifically to the "Include end date" choice.
Does the checkbox alter the time unit?
No. It only contributes its 0 or 1 to the base result. The unit is a separate setting that you change in its own step.
Can I use this option for a span in the past?
Yes. The date to date calculator works both ways, so the end-date choice applies to a historical interval just as it does to a future one.
References
- The source's four-step "How to use the date to date calculator" instructions.
- The includeEndDate option list and its stored values of 0 and 1.
- The source equation result = (currentDate - eventDate) + choice.