Why Your Manual Day Count Was Off by One Day
An off-by-one error in a manual day count almost always comes from inconsistently applying the inclusive-vs-exclusive convention — subtracting the dates directly gives the exclusive count, while forgetting that subtraction already excludes the start date and then adding one anyway (or not adding one when an inclusive count was actually needed) produces a result exactly one day off from the correct answer.
This is one of the most common and most avoidable date-math mistakes, precisely because the underlying arithmetic is otherwise so simple.
The two ways this error happens
Simple subtraction of two dates (end minus start) always produces the exclusive count — the number of full days between them, not counting the start date. Forgetting this and treating the subtraction result as if it were an inclusive count leaves the answer one short of what was actually intended.
The reverse also happens: adding one to a subtraction result out of habit, when an exclusive count was actually what was needed, overshoots by one instead.
A reliable way to avoid it
Before calculating, explicitly decide which count is needed — question up to but not including the end date, or a span that includes both endpoints — and apply that decision consistently, rather than defaulting to whichever method feels natural in the moment.