Counting days between dates
The subtlety in date arithmetic is whether you count the endpoints. Between 1 March and 5 March there are four days of difference but five days inclusive. Contracts, rental agreements, hotel stays and interest calculations each pick their own convention, so check which one applies before trusting a number.
This calculator reports the difference — the number of midnights crossed. Add one if you need an inclusive count.
Why adding months is ambiguous
Adding days is unambiguous. Adding months is not, because months have 28, 29, 30 or 31 days. What is one month after 31 January?
- Overflow — 3 March in a common year. This is what JavaScript and this calculator do.
- Clamping — 28 February. This is what most contracts and many databases do.
Neither is wrong; they are different conventions. If a deadline matters legally, use the wording in the agreement rather than any calculator, because "one month from" and "30 days from" are genuinely different dates.
Where date arithmetic goes wrong in practice
Dates look simple and are famously not. The traps below account for most real-world date errors.
- Time zones. A deadline of “31 March” is a different instant in Auckland and Los Angeles — nearly a full day apart. For anything contractual, state the time zone.
- Daylight saving. Two days a year are 23 or 25 hours long. Adding “24 hours” and adding “one day” give different answers on those days.
- Leap seconds and leap years. February 29 breaks any code that assumes fixed month lengths, which is why annual renewals dated 29 February need an explicit rule.
- Inclusive versus exclusive counting. Rental agreements, hotel stays and interest calculations each pick their own convention. Always check which end is counted.
- Ambiguous formats. 03/04/2026 is 3 April in most of the world and 4 March in the United States. ISO format — 2026-04-03 — removes the ambiguity and sorts correctly as plain text.
The 30-day trap
“Payment due 30 days from invoice” and “payment due one month from invoice” are different dates in every month except one. On a 15 January invoice, 30 days is 14 February; one month is 15 February. On a 31 January invoice the gap is wider still.
Business days, weeks and ISO conventions
Business days here means Monday to Friday. Public holidays are excluded from the count because they differ by country, state and even industry — a US federal holiday is not a UK bank holiday, and neither applies in Japan.
Week numbers use the ISO 8601 standard: weeks start on Monday, and week 1 is the week containing the first Thursday of the year. This means 1 January is sometimes in week 52 or 53 of the previous year, which surprises people but keeps every week exactly seven days long.
Date format is worth a warning: 03/04/2026 is 3 April in most of the world and 4 March in the United States. The ISO format — 2026-04-03 — is unambiguous, sorts correctly as text, and is what this calculator reports.