The Basic Idea
The difference between two dates is how far apart they are โ in days, weeks, months or years. The raw unit is the day: later date minus earlier date, counted in days. Everything else (weeks, months, business days) is a repackaging of that day count under a convention.
Worked example: 15 March 2026 to 1 December 2026
Count the days month by month from 15 March to 1 December:
- 15 Mar โ 31 Mar: 16 days
- April: 30, May: 31, June: 30, July: 31, August: 31, September: 30, October: 31, November: 30 โ 244 days
- 1 December: +1
Total: 261 days (start date not counted, end date counted โ the standard subtraction).
Repackaged: 261 days = 37 weeks and 2 days. In calendar terms: 15 Mar to 1 Nov is 8 months, plus 16 days, so 8 months and 16 days.
Business days (MondayโFriday only): 261 days from a Sunday spans 185 full-week weekdays plus Monday and Tuesday of the last week โ 187 business days.
Days, Weeks, Months, Years โ the Conventions
- Days โ simple subtraction. The only "exact" unit, but watch inclusive vs exclusive counting (below).
- Weeks โ days รท 7. 261 days is 37.29 weeks, or 37 weeks 2 days.
- Months โ count calendar months (15 Mar โ 14 Apr is one month). Months have unequal lengths, so a "month" is never a fixed number of days. Some finance contexts use 30-day months; others use actual/actual.
- Years โ 365 days, or 365.25 to account for leap years, or actual days across the range (finance: 360, 365, or 365.25 conventions such as 30/360).
Inclusive vs exclusive counting
"From Sunday to Friday" is 4 days by subtraction (Friday โ Sunday) but 5 days if you count both endpoints. A hotel stay from the 1st to the 3rd is 2 nights, not 3 days. Always state the convention โ in contracts and deadlines, "inclusive of both dates" changes the number by one.
Timezones
A "date" is only meaningful in a timezone. A meeting on 12 June in Tokyo and a deadline on 12 June in New York are different instants, and the day between two dates can shift if you compare "12 June in one zone" with "12 June in another" across a date boundary. Pick one timezone for the whole calculation and stick to it.
Tools That Do It For You
For the day/week/month/weekend breakdown, the Date Difference Calculator takes two dates and returns days, weeks, months, years, business days and the day of week for each date. For a specific case โ how old is someone? โ the Age Calculator anchors the end date to today and returns the exact age in years, months and days, handling leap days. For developers working in epoch time, the Unix Timestamp Converter gives you seconds: divide the difference by 86,400 to get days. All three run in your browser.
Common Pitfalls
- Mixing conventions โ comparing "30 days" (banking 30/360) with "actual days" gives different answers on the same dates.
- Forgetting the endpoint โ off-by-one errors are the most common date bug in code and contracts alike.
- Leap years โ 2024 had 366 days; ranges crossing February in a leap year are one day longer than the calendar suggests.
- Timezone drift โ converting to UTC first, then counting, avoids the "which day is it really?" argument.