How to calculate days between dates, add days, and find the weekday
This date calculator answers three common questions. Date Difference shows the exact span between two dates in days, business days, weekend days, weeks, months and hours. Add / Subtract finds the date a given number of days, weeks or months before or after another date. Day of Week tells you which weekday any date falls on, along with its ISO date, day of the year, week number and quarter.
Calculations use the date-fns library and run in your browser — handy for project deadlines, notice periods, SLAs, subscription renewals and sprint planning.
How to use the calculator
- Choose a tab: Date Difference, Add / Subtract or Day of Week.
- Pick the dates with the date pickers (or type them as
YYYY-MM-DD). - For Date Difference, tick include end date if both the first and last day should count. For Add / Subtract, enter an amount and choose days, weeks or months.
- Read the results; each calculation is saved to the history panel for later.
| Question | Answer |
|---|---|
| Days from 2026-01-01 to 2026-12-31 | 364 days (365 with "include end date") |
| Business days in that range | 260 (Mon–Fri, no holidays) |
| 2026-01-31 + 1 month | 2026-02-28 (clamped to the end of February) |
| 2026-10-09 + 90 days | 2027-01-07 |
| Weekday of 2026-12-25 | Friday |
How the counting works
- Day differences exclude the end date by default. From Monday to Friday is 4 days. If your contract or event counts both the first and last day, turn on include end date.
- Business days count Monday to Friday in the range (the start date itself isn't counted). Public holidays vary by country and aren't subtracted, so remove them yourself for a precise working-day count.
- Adding months keeps the day of the month where possible and otherwise clamps to the last valid day: 31 January + 1 month is 28 February (29 in a leap year).
- Week numbers on the Day of Week tab use the US convention (weeks start on Sunday, week 1 contains 1 January). ISO 8601 week numbers — Monday start, week 1 contains the first Thursday — can differ by one around New Year.
- Leap years — divisible by 4, except centuries not divisible by 400 — are handled automatically. 2028 is the next leap year.
Doing the same in code
// JavaScript with date-fns
import { differenceInCalendarDays, differenceInBusinessDays, addMonths } from "date-fns";
differenceInCalendarDays(new Date(2026, 11, 31), new Date(2026, 0, 1)); // 364
addMonths(new Date(2026, 0, 31), 1); // 2026-02-28
# Python
from datetime import date, timedelta
(date(2026, 12, 31) - date(2026, 1, 1)).days # 364
date(2026, 10, 9) + timedelta(days=90) # 2027-01-07
-- PostgreSQL
SELECT DATE '2026-12-31' - DATE '2026-01-01'; -- 364
SELECT DATE '2026-01-31' + INTERVAL '1 month'; -- 2026-02-28Working with timestamps rather than calendar dates? Use the Unix timestamp converter, which also converts between timezones.
Frequently asked questions
Does the day count include the start and end dates?
By default it counts the days between them, excluding the end date — the same as subtracting one date from another in most programming languages. Turn on "include end date" for an inclusive count.
Are public holidays excluded from business days?
No. Business days are Monday to Friday only, because holidays differ by country and region. Subtract the holidays that apply to you.
What happens when I add a month to January 31?
The result is the last day of February (28th, or 29th in a leap year), because February 31 doesn't exist. This matches the behaviour of date-fns and most database date functions.