Skip to content

Date Calculator — Add or Subtract Days, Months, Years from a Date

Last verified May 2026 — runs in your browser
Add or subtract time from a date
May 21, 2026
Thursday — 2026-05-21

Quick Add

Date Calculator — Add/Subtract Days, Months, Years from a Date Online

Pick a starting date, choose what to add or subtract (days, weeks, months, years), and the page shows the resulting date plus the day of the week it lands on. The month/year arithmetic is calendar-aware: Jan 31 + 1 month becomes Feb 28 (or Feb 29 in a leap year), not the often-naive Mar 3 you'd get from adding 30 days. Quick presets cover "+1 week", "+30 days", "+90 days", "+6 months", "+1 year". Useful for computing contract end dates, payment due dates, project milestones, anniversary calculations, gestational due dates (40 weeks from LMP), or any kind of forward/backward calendar math without manually counting on a calendar.

About this tool

Day arithmetic is straight `start + days × 86_400_000` ms, then re-parsed to a calendar date — simple and correct. Month arithmetic adds `delta` to `getMonth()` then applies explicit day-clamping on top — important because ECMA-262 §21.4.4.25 native `Date.setMonth` actually overflows to the following month if the previously-set day exceeds the new month's days (Jan 31 + native `setMonth(1)` = Mar 2/3, not Feb 28 — that's the bug a lot of homemade date math hits). With the explicit clamping the tool applies, Jan 31 + 1 month = Feb 28 (or Feb 29 in a leap year). Year arithmetic is just `setFullYear`, which similarly clamps Feb 29 → Feb 28 on non-leap years (relevant for people born on Feb 29 figuring out what day they technically observe their birthday). The output is in ISO 8601 format (YYYY-MM-DD), the only date format that sorts correctly as a string and works without ambiguity across locales (US 02/03 vs EU 02/03 — never have that conversation). Day-of-week is computed via the underlying Date object's getDay(), which is calendar-correct. Use cases: contract end-date math (lease starts X, ends X + 12 months), payment terms (invoice + 30 days net), project planning (kickoff + 6 months), gestational due-date (LMP + 280 days = 40 weeks via Naegele's rule), course completion (start + N weeks).

  • Add or subtract days, weeks, months, years from any starting date
  • Calendar-aware month math (Jan 31 + 1 month = Feb 28, not Mar 3)
  • Year math handles Feb 29 correctly on non-leap target years
  • Quick preset buttons (+1 week, +30 days, +90 days, +6 months, +1 year)
  • ISO 8601 output (YYYY-MM-DD) — sorts correctly, locale-unambiguous
  • Resulting day-of-week displayed alongside the date
  • Negative deltas supported (subtract)
  • Reactive — re-computes as you change start date or delta
  • No upload — your dates stay in your browser
  • Useful for contract math, payment terms, gestational due-date, project planning

Free. No signup. Your inputs stay in your browser. Ads via Google AdSense (consent required).

Frequently asked questions

What does "Jan 31 + 1 month" actually mean — Feb 28 or Mar 2?

Both, depending on which arithmetic you ask for. The naive answer is Mar 2 (Jan 31 + 31 days = Mar 2 in a non-leap year, Mar 3 in a leap year), and that's what JavaScript's native `Date.prototype.setMonth(1)` produces — ECMA-262 §21.4.4.25 specifies that when the previously-set day exceeds the new month's days, the date overflows to the following month. The calendar-aware answer is Feb 28 (Feb 29 in a leap year): clamping the day to the last day of the target month. Most legal/financial contexts assume the calendar-aware clamping convention (a "monthly billing cycle" starting Jan 31 bills again Feb 28, Mar 31, Apr 30, May 31, Jun 30 — never spilling to "Feb 31" or rolling forward). This tool applies explicit clamping on top of `setMonth`. The TC39 Temporal API (Stage 3 as of 2026) provides `Temporal.PlainDate.with({day: 'last'})` for the same clamping idiom.

How does the Gregorian leap year rule work, and which years are leap?

The Gregorian leap year rule, codified by Pope Gregory XIII's papal bull Inter gravissimas (24 February 1582), is: a year is a leap year if it is divisible by 4, EXCEPT if it is divisible by 100, EXCEPT if it is divisible by 400. Worked examples: 2024 ÷ 4 = leap. 1900 ÷ 4 leap, but ÷ 100 not leap, and not ÷ 400 → NOT a leap year. 2000 ÷ 4 leap, ÷ 100 not leap, but ÷ 400 leap → IS a leap year. 2100 ÷ 4 leap, ÷ 100 not leap, not ÷ 400 → NOT a leap year. The rule keeps the calendar's mean year at 365.2425 days, matching the tropical year to within ~27 seconds (drifts 1 day every ~3,225 years). Feb 29 birthdays observe Feb 28 on non-leap years for civil purposes (some jurisdictions use Mar 1). The 1582 reform also skipped 4–15 October 1582 to realign the vernal equinox; Britain followed in 1752 (skipping 11 days), Russia in 1918, Greece in 1923.

What's Naegele's rule for due-date calculation?

Naegele's rule, formulated by Franz Karl Naegele (Heidelberg professor of obstetrics, 1812), estimates a pregnancy's due date as LMP (last menstrual period) + 280 days = LMP + 40 weeks = LMP + 9 calendar months + 7 days. It assumes a 28-day menstrual cycle with ovulation on day 14, so it's a population-average heuristic. Modern obstetric practice (ACOG Committee Opinion 700, May 2017) confirms Naegele's rule as the starting point but recommends first-trimester ultrasound crown-rump length (CRL) measurement for redating if the ultrasound estimate differs from LMP-based dating by more than 5 days in trimester 1 or 7 days in trimester 2. Beyond 22 weeks, ultrasound dating becomes too imprecise to override LMP-based EDD. Practical use: enter your LMP in the date calculator, add 280 days, get the EDD; subtract 280 to back-calculate LMP from a known ultrasound EDD.

Why does the tool output ISO 8601 (YYYY-MM-DD) and not a localised format?

ISO 8601:2019 (YYYY-MM-DD) is the only widely-supported date format that meets two critical properties: it's locale-unambiguous (the US "02/03" reads as Feb 3, the EU "02/03" as March 2 — never the same conversation in ISO format) and it's lex-sortable as a plain string (so "2024-12-31" < "2025-01-01" sorts correctly without parsing). RFC 3339 (the IETF profile of ISO 8601, Klyne & Newman 2002) is mandated for JSON Schema, OpenAPI specifications, JWT iat/exp claims, HTTP Date headers, structured logs, and ISO TIMESTAMP database columns. The day-of-week shown alongside is computed by JavaScript's `Date.prototype.getDay()` which returns 0–6 (Sunday–Saturday) per ECMA-262. If you need a localised display format ("31 December 2024" or "31.12.2024"), do that conversion in user-facing UI just before render — never in storage, transmission, or interchange.

How do contract / lease / payment-term date conventions work?

Common contract date conventions: "Net 30" = invoice issue date + 30 calendar days (not business days unless specified); some industries use Net 60, Net 90, or 2/10 Net 30 (2% discount if paid within 10 days, full balance due in 30). Lease "12-month term" = lease start date + 12 calendar months (same calendar day next year, clamped if the start day doesn't exist in the end month — a Feb 29 lease ends Feb 28). Insurance "1-year policy" = effective date + 1 calendar year, day-clamped. Mortgage payment due dates roll on the calendar day each month (a 31st-of-month mortgage clamps to month-end on shorter months — typically Feb 28/29 + Apr/Jun/Sep/Nov 30). Court filing deadlines typically count business days exclusive of weekends and public holidays, plus a "next business day" rule if the deadline falls on a weekend. Always check the contract's defined-terms section for exact "day" and "month" definitions — most jurisdictions default to calendar days but explicit specification overrides default.

Sources (7)
  • Ecma International (2024). ECMA-262, 15th edition (June 2024) — ECMAScript Language Specification §21.4 Date Objects; §21.4.4.25 Date.prototype.setMonth(month, date?) overflows to the following month if the previously-set day exceeds the new month's days (Jan 31 + native setMonth(1) = Mar 2/3, not Feb 28); explicit day-clamping must be applied on top of native setMonth for calendar-aware month arithmetic. Ecma International TC39; Temporal API at TC39 Stage 3 (2026) provides Temporal.PlainDate.with({day: 'last'}) for explicit clamping.
  • International Organization for Standardization (2019). ISO 8601-1:2019 — Date and time format YYYY-MM-DD (only locale-unambiguous + lex-sortable as plain string). ISO Technical Committee 154 (TC 154); supersedes ISO 8601:2004.
  • Klyne, G., & Newman, C. (2002). RFC 3339 — Date and Time on the Internet: Timestamps (IETF profile of ISO 8601 mandated for HTTP Date headers, JSON Schema, OpenAPI, JWT iat/exp, structured logs). Internet Engineering Task Force, Request for Comments 3339, July 2002 (Standards Track).
  • Pope Gregory XIII (1582). Papal bull Inter gravissimas (24 February 1582) — Gregorian calendar reform; leap year rule = year divisible by 4 AND (not divisible by 100 OR divisible by 400); examples: 2000 leap (÷ 400), 1900 not leap (÷ 100 not ÷ 400), 2024 leap, 2100 not leap; mean Gregorian tropical year 365.2425 days. Papal States; adopted by Catholic Europe 1582-1584, Britain 1752, Russia 1918, Greece 1923.
  • Naegele, F. K. (1812). Naegele's rule for estimated due date (EDD) — LMP + 280 days = LMP + 40 weeks (= LMP + 9 calendar months + 7 days); the foundation for obstetric dating; ACOG modern practice (Committee Opinion 700, May 2017) confirms Naegele's rule but recommends first-trimester ultrasound CRL (crown-rump length) for redating if discordant by > 5 days T1 / > 7 days T2. Franz Karl Naegele, Heidelberg professor of obstetrics, 1812; modern guidance from American College of Obstetricians and Gynecologists (ACOG) Committee on Obstetric Practice.
  • IEEE / The Open Group (2018). POSIX.1-2017 (IEEE Std 1003.1-2017) — defines time_t as seconds since the Unix epoch 1970-01-01T00:00:00Z UTC; ms-since-epoch is the JavaScript Date internal representation. Institute of Electrical and Electronics Engineers / The Open Group joint standard (current revision IEEE Std 1003.1-2024).
  • World Wide Web Consortium (W3C) (2018). Web Content Accessibility Guidelines (WCAG) 2.1 — Success Criterion 4.1.3 Status Messages. W3C Recommendation 5 June 2018; carried unchanged into WCAG 2.2 (Recommendation 5 October 2023).

These are the original publications the formulas in this tool are based on. Locate them by journal name and year on Google Scholar or PubMed.