Date Calculator
Calculate the number of days between two dates (inclusive or exclusive), count weekdays, and add or subtract days from a date. All local, DST-safe.
How long does a project run, when does a contract expire, how many days of leave from one date to another, what date falls 30 days from today — interval and date arithmetic is basic scheduling hygiene. This tool counts the days between two dates (exclusive or inclusive), counts the weekdays between them, and adds or subtracts a number of days from any date, reporting the resulting day of the week.
On conventions: the interval is exclusive by default (the 1st to the 2nd is one day), while the inclusive count takes both ends, as accommodation and rental periods usually are. Weekday counting excludes weekends only — public holidays are not accounted for here, so subtract them yourself when they matter. The calculation runs on UTC milliseconds, so no daylight-saving transition can shift the result by an hour.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Choose the interval mode and enter two dates for the exclusive and inclusive counts.
- Read the number of weekdays between them (weekends excluded, holidays not).
- Switch to add or subtract mode to find the date N days before or after a given one.
- Check the day of the week for both the starting date and the result.
How it works
Days between two dates
Day interval: convert both dates to UTC milliseconds, subtract and divide by 86400000. 2026-01-01 to 2026-01-31 is 30 days (excluding the start day), or 31 counting both ends.
Adding and subtracting days
Date arithmetic: the start date plus (or minus) N days gives the target date. For example 2026-01-01 plus 45 days is 2026-02-15, a Sunday.
Counting workdays
Workdays count Monday to Friday (inclusive, ignoring statutory holidays and make-up days). For example 2026-01-01 (Thursday) to 2026-01-04 (Sunday) is 4 days inclusive, of which 2 are workdays.
Code example
JavaScript Interval from a UTC millisecond difference (DST-proof)
const DAY = 86400000;
const utcMidnight = (d) => Date.UTC(d.getFullYear(), d.getMonth(), d.getDate());
function diffDays(a, b) {
return Math.round((utcMidnight(b) - utcMidnight(a)) / DAY);
}
diffDays(new Date(2026, 8, 1), new Date(2026, 8, 15)); // 14
// Inclusive of both ends = diffDays + 1; subtracting local midnights is off by an hour in DST zones
Python Subtracting dates gives the day count directly
from datetime import date
(date(2026, 9, 15) - date(2026, 9, 1)).days # 14
# Adding N days:
from datetime import timedelta
date(2026, 9, 1) + timedelta(days=30) # 2026-10-01
FAQ
Does the day interval include the start day?
By default the tool gives the interval excluding the start day (Jan 1 to Jan 31 is 30 days) and also the inclusive result (31 days). Project timelines and exam countdowns usually use inclusive; interest and age spans use excluding — take what you need.
Does the workday count include statutory holidays?
This tool counts Monday-Friday only. To include statutory holidays and make-up workdays, use the workday calculator, which has 2024-2026 holiday arrangements built in with no manual entry.
Why is another tool's result off by one day?
Usually a convention difference (inclusive or not) or a timezone/daylight-saving issue. This tool uses UTC millisecond differences, tied only to the dates themselves, unaffected by timezone or DST.
How do I count the number of days between two dates?
Convert both to UTC milliseconds, subtract and divide by 86400000 (the milliseconds in a day), then truncate. Using UTC rather than local time avoids hour-level error from daylight-saving switches for a more stable result.
Why does February have 29 days in leap years?
Earth's orbit takes about 365.2422 days, accumulating roughly one extra day every four years, so a leap year adds Feb 29 every four years. But century years must be divisible by 400 to be leap, so 2000 is leap and 1900 isn't — a further correction.
Which feature for "how many days until a date"?
Use date arithmetic or a countdown feature. This tool adds or subtracts N days from a base date and shows the weekday of the target; for a plain "days remaining" countdown, pair it with the countdown calculator.
Does the day count exclude weekends and holidays?
The tool gives both calendar days and Monday-Friday workdays; workdays exclude weekends but not statutory holidays. For delivery deadlines and approval limits, use the workday calculator, which has 2024-2026 holidays and make-up workdays built in.