Date Difference Errors: Leap Days, Off-by-One, DST
Five errors that break invoices, contracts, and legal deadlines.
Avoid the five common errors and your date math stops costing interest, fees, and contract fights.
Contracts and invoices hinge on exact day counts. The common errors are predictable: inclusive-vs-exclusive off-by-one, missed leap days, month-end arithmetic, and DST-shift boundary effects.
Quick answer
Avoid the five common errors and your date math stops costing interest, fees, and contract fights.
Key points
- ▸ Inclusive vs exclusive: from Jan 1 to Jan 10 is 9 days (exclusive) or 10 days (inclusive). Specify which convention.
- ▸ Leap-day miss: 2020 and 2024 add Feb 29. Span 2019-01-01 to 2025-01-01 = 2,193 days, not 2,190 (3 leap days).
- ▸ Month-end quirk: Jan 31 + 1 month = Feb 28/29. Different libraries handle end-of-month differently.
- ▸ DST: "24 hours" can be 23 or 25 hours on DST transition days. Day-counts usually unaffected, but hour-level math breaks.
- ▸ 29 Feb to 29 Feb: spans non-leap years need a convention. Usually 4 years, exactly.
Examples
- Invoice dispute"Net 30" from 2024-02-14 is 2024-03-15 (exclusive) or 2024-03-16 (inclusive)? Misunderstanding costs a day's interest.
- Leap day errorMental math: "2020-01-01 to 2024-01-01 is 4 × 365 = 1,460 days." Wrong — it is 1,461 (one leap day, 2020).
- Month-end bugSubscription starts Jan 31, monthly. Next charge: Feb 28? Mar 1? Different rules in different systems.
When to use which tool
Related
Frequently asked questions
› Is "30 days" the same as "1 month"? Trust & accuracy
No. "30 days" is exact; "1 month" is 28-31 depending on month. Contracts should say one or the other, not both.
› How do I count business days? How-to
Standard date-diff gives calendar days. Business-day count (excluding weekends and holidays) needs a separate tool.
› How should I use this guide with a Kefiw tool? How-to
Use the guide as the plan and the linked Kefiw tool as the check. Read the steps first, try the move manually, then use the tool to compare outputs, catch edge cases, and decide whether the result actually fits your task.
› What mistake do tool guides help avoid? Troubleshooting
Tool guides help avoid using a utility mechanically without understanding what you are trying to accomplish. Most word, writing, and text utilities are fast, but speed can hide context mistakes. Know whether you are solving a puzzle, cleaning copy, drafting a line, or checking a rule.
› Can a tool guide help me learn the skill? How-to
A tool guide can help you learn if you pause before accepting the output and ask why it worked. Compare your first guess with the tool result, look for the rule or pattern, and repeat that review. Passive copying solves one task; active review builds the skill.