Counting Days Between Dates: Leap Years, Business Days and Off-by-One Errors
Published · 3 min read · By The Samsung Calculator editorial team
Why one day matters
Contract notice periods, statutory filing deadlines, return windows, interest accrual and visa durations are all counted in days, and being one day out has consequences that range from a late fee to a rejected filing. Date arithmetic looks trivial and is the source of a remarkable number of expensive errors.
Four ways date counting goes wrong
Inclusive versus exclusive counting. From the 1st to the 8th is seven days if you count the gap and eight if you count the days involved. Hotel nights, hire periods and interest use the gap; notice periods and prison sentences usually count inclusively. Neither convention is more correct — you have to know which one your document means.
Assuming the count starts on the trigger date. Most legal deadlines start the day *after* the triggering event. A '30 days from receipt' clause with delivery on the 1st usually expires on the 31st, not the 30th.
Month arithmetic without a rule. What is one month after 31 January? Different systems answer 28 February, 2 March or 3 March. Spreadsheets, databases and legal conventions all differ, and there is no universal right answer — only a stated one.
Forgetting the leap year rule properly. Divisible by 4 is a leap year, except centuries, except centuries divisible by 400. 2000 was a leap year; 1900 was not; 2100 will not be. Software that got this wrong caused real failures in 2000, and a surprising amount of code still gets 2100 wrong today.
How to check a disagreement
When two tools differ by exactly one day, it is almost always the inclusive/exclusive question, not a bug. Test both with a known trivial case — 1 January to 2 January — and see which returns 1 and which returns 2. When they differ by more, look for a time-zone boundary: a date stored as a timestamp can shift a day when rendered in another zone, which is why date-only values should never carry a time component.
Count it here
The days between dates calculator shows total days, business days and weekends separately, so you can see which convention produces which number rather than guessing.
Questions this answers
- how to calculate date difference in excel
Run your own numbers
Count the exact number of days between two dates, with business days, weekends, weeks and months shown alongside.
About this article
Written and reviewed by The Samsung Calculator editorial team. Every calculator is written against a published formula, reviewed against at least one independent reference implementation, and dated when it changes. Last updated July 10, 2026. Spotted an error? Tell us.