Inclusive vs exclusive counting
The question "how many days are between two dates?" has two valid answers depending on what you want to measure. Exclusive counting (our default) measures the interval: from January 1 to January 8, 7 days pass. Inclusive counting treats both endpoints as full days, so that same range gives 8. The "include the end day" checkbox lets you pick. For deadlines and due dates the exclusive count is usually right; for bookings where the arrival and departure days both count, use the inclusive one.
How business days are counted
Business days are Monday through Friday; Saturdays and Sundays are left out. The calculator walks the range day by day and adds only the ones that fall on a weekday. This is handy for estimating delivery windows, administrative timelines or commercial due dates. One important note: we do not subtract public holidays, because they change by country, region and year. If you need the calculation with holidays included, manually subtract the ones that fall on weekdays inside your range.
Full months and years
Converting a number of days into "months" is not as simple as dividing by 30, because months have between 28 and 31 days. So we compute months and years by subtracting year, month and day separately and correcting negatives with borrowing — the same arithmetic used to calculate an exact age. That way you get "2 years, 3 months and 12 days" instead of a rounded approximation.
Why we use UTC
Subtracting with the browser local time is a classic trap: if a daylight saving change falls in the middle of the range, one of the days has 23 or 25 hours instead of 24, and the division by 86,400,000 milliseconds is off by one. To avoid it, we build the dates with Date.UTC, where every day has exactly 24 hours regardless of time zone. The result is always exact, with no "off by one day" errors.
Common uses
- Calculate job tenure or accumulated vacation days.
- Find out how many days are left until a deadline or due date.
- Count business days to estimate delivery timelines.
- Measure the duration of a project, a pregnancy or a subscription.
- Convert a date range into weeks, months or hours.
Reference: day equivalents
Common durations to keep handy when reading the result.
| Period | Equivalent in days |
|---|---|
| 1 week | 7 days |
| 1 fortnight | 14 days |
| 1 month (average) | ≈ 30.44 days |
| 1 quarter | ≈ 91 days |
| 1 common year | 365 days |
| 1 year (average with leap years) | 365.25 days |
| 1 leap year | 366 days |