Date Add/Subtract Calculator
Add or subtract days, weeks, months, years from a date
Add or subtract days from a date
What is a Date Add/Subtract Calculator?
A date add/subtract calculator finds a target date by moving a starting date forward or backward by a chosen number of days, weeks, months, or years. It helps when you need a renewal date, follow-up date, contract deadline, warranty end date, or reminder without counting a calendar by hand. The tricky part is not adding days, but handling real calendar boundaries: months have different lengths, years can be leap years, and a date such as January 31 may not exist in the next month. This tool gives a practical calendar result for quick planning. It counts calendar time only, so business-day rules, holidays, regional regulations, and legal deadlines still need separate verification.
How to Use
How to use
- Enter the start date
- Select add (forward) or subtract (backward)
- Enter the value and select a unit (day/week/month/year)
- Click 'Calculate result' to see the target date
Date Rules
- Month and year calculations can land on shorter months; check how your business rule handles dates such as January 31 plus one month.
- For deadlines, confirm whether weekends, holidays, or end-of-day cutoffs should change the final date.
Use Cases
Technical Principle
Date arithmetic in this tool is built on the proleptic Gregorian calendar as implemented by the ECMAScript Date object. Months in JavaScript are 0-indexed (January is 0, December is 11), which is the single biggest source of off-by-one bugs in date code. Adding days is straightforward: new Date(d.getTime() + n * 86_400_000). Adding months is harder because months have 28, 29, 30, or 31 days: the standard idiom date.setMonth(date.getMonth() + n) overflows when the resulting month is shorter than the source day, so January 31 + 1 month produces March 3 rather than February 28 (the engine carries the extra 3 days forward into March). This tool detects the overflow by comparing date.getMonth() after setMonth and clamps the day to the last day of the target month when needed, matching the behavior of moment.js, date-fns, and Temporal's Plain Date.add(). Leap years follow the standard Gregorian rule: a year is a leap year if it is divisible by 4, except for centuries, which must also be divisible by 400. So 1900 and 2100 are common years, while 2000 was a leap year and 2024 is too. This matters whenever a calculation crosses February 29: January 29 + 1 month + 1 month in 2023 gives March 29, but in 2024 the rollover hits February 29 (a valid date) and then March 29, with no clamping needed. The Year 1582 cutoff for the Julian-to-Gregorian transition is ignored here because the proleptic Gregorian extends the rules backward indefinitely; dates before October 15, 1582 are technically anachronistic but still compute correctly for modern purposes. Timezone handling is a separate dimension: Date stores a UTC instant internally and applies the host system's IANA timezone (e.g. America/New_York, Asia/Shanghai) only when calling .getDate(), .getMonth(), or .toLocaleString(). Two pitfalls follow: (1) a date constructed from an ISO string without a Z suffix ("2026-06-10") is parsed as midnight UTC, but "2026-06-10T00:00:00" without the Z is parsed as local-time midnight, and the same date.getDate() can return 9 or 10 depending on the user's offset; (2) DST transitions in spring (skip 02:00-03:00) and autumn (repeat 01:00-02:00) make some arithmetic ambiguous, so a "+24 hours" addition can land on a wall-clock that is 23 or 25 hours away. For business-day, weekday-only, or holiday-aware arithmetic, the calendar result here must be post-processed against a region-specific holiday list (e.g. through the date-holidays npm package or a custom calendar) rather than relying on the plain rollover.
- JS Date months are 0-indexed: January = 0, December = 11; off-by-one is the most common mistake.
- setMonth overflow: Jan 31 + 1 month gives Mar 3, not Feb 28; tool clamps to month-end by comparing getMonth() after setMonth.
- Leap year: divisible by 4, but century years must also be divisible by 400 (so 1900 no, 2000 yes, 2024 yes).
- ISO 8601 without Z ("2026-06-10T00:00:00") parses as local time; with Z it is UTC - getDate() can return different days.
- DST transitions create 23-hour and 25-hour days; +24h addition is not always +1 calendar day.
- Day-level math is exact via getTime() + n * 86_400_000; longer units cascade through setMonth/setFullYear with clamping.
- Business-day and holiday-aware arithmetic must be layered on top via a region-specific calendar table - not in the engine itself.
Examples
Add 90 days to a start date (trial / OKR review)
Start date : 2026-01-15 (Thursday)
Operation : + 90 days
Result : 2026-04-15 (Wednesday)
Use case : 90-day trial period end, Q1 OKR reviewSubtract 6 months from today
Start date : 2026-06-11
Operation : - 6 months
Result : 2025-12-11
Use case : Look back six months for renewal or churn analysisAdd 2 years 3 months 5 days (visa expiry)
Start date : 2026-01-15
Step 1 : + 2 years -> 2028-01-15
Step 2 : + 3 months -> 2028-04-15
Step 3 : + 5 days -> 2028-04-20
Result : 2028-04-20Month-end rollover: Jan 31 + 1 month
Start date : 2026-01-31
Operation : + 1 month
Result : 2026-02-28 (Feb has 28 days in 2026)
Leap year check:
Start date : 2028-01-31
Operation : + 1 month
Result : 2028-02-29 (2028 is a leap year)Subtract 14 days for a billing reminder
Subscription renewal : 2026-07-01
Operation : - 14 days
Send reminder on : 2026-06-17FAQ
How does adding 'months' work for end-of-month dates?
Months don't all have the same number of days, so adding 1 month to Jan 31 is ambiguous. The calculator follows the standard convention: clamp to the last day of the target month - Jan 31 + 1 month = Feb 28 (or 29 in leap years). This matches Excel's EDATE function.
Are weekends and holidays counted?
By default yes - 'add 5 days' adds 5 calendar days. For business-day calculations (skipping weekends and optionally holidays) use the dedicated 'Workday Calculator' tool; this page is for raw calendar arithmetic.
Can I add years, months, weeks, and days at once?
Yes. The result applies them in the order years → months → weeks → days, which is the convention used by most date libraries including JavaScript's Temporal proposal. This order matters: '1 month and 30 days' added to Jan 1 lands differently than '30 days and 1 month'.
How does it handle daylight saving time?
The calculation operates on calendar dates, not absolute time, so adding 'one day' across a DST transition still produces the same time-of-day in the local zone. If you need 24-hour-precise arithmetic, switch the unit to hours instead of days.
What's the supported date range?
JavaScript Date covers ±100,000,000 days from 1970, which is roughly years -271,821 to 275,760. The calculator handles any historical or far-future date in that range. For dates before the Gregorian calendar reform (1582), be aware that local civil calendars differ.
Why is subtracting two dates different from adding negative days?
They aren't - subtracting N days is the same as adding -N. If you want the difference between two dates use the 'Date Difference' tool. This page is one-direction arithmetic: start date plus or minus a duration.
Is my data uploaded?
No. The calculation runs in your browser. Inputs are cleared on page refresh.