Skip to content
Everyday Utilities Free · No signup · Private · Instant results

Add or Subtract Date

Add or subtract days, weeks, months, or years from any date.

About the Add or Subtract Date

This Date Add/Subtract Calculator finds a date a specified number of years, months, weeks, or days from a base date — useful for setting deadlines, scheduling recurring events, and computing maturity dates for contracts. The tool uses the JavaScript Date object’s arithmetic methods, which handle variable month lengths, leap years, and DST transitions correctly.

Date arithmetic is deceptively complex because the units do not compose uniformly. Adding one month to January 31 gives February 28 (or 29 in a leap year), not ‘February 31’ — the JavaScript Date.setMonth() method handles this overflow by clamping to the last valid day of the target month. Adding 365 days is not the same as adding 1 year, because leap years have 366 days. The tool applies operations in the order: years, then months, then weeks, then days — matching the conventional order used in financial and legal contexts.

The result is returned in both ISO 8601 format (YYYY-MM-DD) and a human-readable form (‘March 8, 2025’), along with the day of the week. A delta-days summary shows the total day shift, useful for confirming that the calculation produced the expected magnitude.

How It Works

The tool constructs a Date object from the base date, set to noon (12:00:00) local time to avoid DST edge cases. Noon is the safe choice because DST transitions occur at 2 AM in most jurisdictions — a calculation that crosses midnight might land on a 23- or 25-hour day, but noon is always 24 hours from the next noon.

Operations are applied in sequence using the Date object’s mutator methods: setFullYear for years, setMonth for months, setDate for days (with weeks multiplied by 7). Each mutator adjusts the date relative to its current state, so adding 1 month to March 31 gives April 30 (clamped), and adding 1 more month gives May 30 (not May 31).

The clamping behavior matches the behavior of Python’s datetime, Java’s LocalDate.plusMonths(), and PostgreSQL’s date + interval. It is the convention used by virtually all financial and legal date-arithmetic systems. If you need strict ‘overflow carries to next month’ behavior, the calculator would need to skip the clamping — let us know if you need this option.

The delta-days summary computes the total day shift by subtracting the result from the base and converting to days. For pure year/month operations, this delta varies depending on the months involved (a year shift on a leap-year base adds 366 days; on a non-leap base, 365). The delta is therefore informational, not prescriptive.

Worked Examples

Base 2025-01-31, add 1 month: result is 2025-02-28 (clamped from February 31, which does not exist). The delta is +28 days, not +30 or +31. Note: if you then add another month, you get 2025-03-28, not March 31 — the original day-of-month is lost once clamping occurs.

Base 2024-02-29 (leap day), add 1 year: result is 2025-02-28 (clamped, since 2025 is not a leap year). Adding 4 years gives 2028-02-29 — the next leap day. Legal systems differ on how to handle February 29 birthdays in non-leap years; some treat them as February 28, others as March 1.

Base 2025-03-08, subtract 90 days: result is 2024-12-08. Useful for calculating ‘X days ago’ for trend analysis, refund windows, or warranty expirations.

Base 2025-01-01, add 1 year + 1 month + 1 week + 1 day: result is 2026-02-09. The compound shift is computed by applying years first, then months, then weeks, then days — matching the order used by financial institutions for maturity date calculations.

When to Use This Tool

  • Calculating contract maturity dates (e.g. 90-day payment terms from invoice date).
  • Scheduling recurring events (weekly stand-ups, monthly retrospectives, annual reviews).
  • Setting legal deadlines — many jurisdictions count ‘30 days from service’ using business-day rules, but some use calendar days.
  • Computing project timelines — start date plus expected duration yields the end date.
  • Pregnancy due-date estimation (LMP + 280 days, or 40 weeks).
  • Subscription renewal dates — free trial ends X days from sign-up; annual renewal is 1 year from sign-up.
  • Warranty expiration dates for consumer products (typically 1 or 2 years from purchase).

Limitations & Disclaimer

This calculator uses the JavaScript Date object’s mutator methods (setFullYear, setMonth, setDate), which handle month overflow by clamping to the last valid day of the target month (matching Python, Java, and PostgreSQL conventions). Operations are applied in the order: years, then months, then weeks, then days — the order matters in rare cases. The calculator does not implement ‘carry to next month’ overflow behavior (January 31 + 1 month = February 28, not March 3). DST transitions are handled by constructing the date at noon local time. See our disclaimer for full terms.

Frequently Asked Questions

Why does adding 1 month to January 31 give February 28?

February has only 28 (or 29 in leap years) days, so JavaScript&rsquo;s <code>Date.setMonth()</code> clamps the day to the last valid day of the target month. This matches the convention used by Python, Java, and PostgreSQL. If you need &lsquo;overflow carries to next month&rsquo; behavior (January 31 + 1 month = March 3), the calculator would need custom logic &mdash; let us know if you need this option.

What is the order of operations?

Years, then months, then weeks, then days. This order matches the convention used by financial and legal date-arithmetic systems. The order matters in rare cases: adding 1 month + 30 days to January 31 gives different results depending on whether months or days come first (March 30 vs. March 2).

Why is the result sometimes one day off from another calculator?

Some calculators apply operations in a different order (days before months) or handle month overflow differently (carry-to-next-month instead of clamping). This tool follows the convention used by Python&rsquo;s <code>datetime</code>, Java&rsquo;s <code>LocalDate.plusMonths()</code>, and PostgreSQL&rsquo;s <code>date + interval</code> &mdash; the de facto standard for financial date arithmetic.

Does the calculator handle leap years correctly?

Yes. Adding 1 year to <code>2024-02-29</code> (a leap day) gives <code>2025-02-28</code> (clamped, since 2025 is not a leap year). Adding 4 years gives <code>2028-02-29</code> &mdash; the next leap day. The browser&rsquo;s <code>Date</code> object implements the Gregorian leap-year rule (divisible by 4, except centuries, except quadricenturies).

Can I add or subtract both positive and negative amounts?

Yes &mdash; the &lsquo;Operation&rsquo; dropdown controls the sign. To add 2 years and subtract 30 days, set op=&lsquo;add&rsquo;, years=2, days=30, then run twice (or do it in two steps). For mixed operations in a single calculation, use the &lsquo;add&rsquo; operation with positive amounts for everything you want to add, then run again with &lsquo;subtract&rsquo; for what you want to remove.

Why does the calculator use noon instead of midnight?

Midnight calculations can land on a DST transition (in many jurisdictions, DST starts or ends at 2 AM, but midnight is also affected in some). Noon is always 24 hours from the next noon, so day-count deltas are accurate regardless of DST. The displayed date is the calendar date, which is unaffected by the time-of-day choice.

Last updated: September 9, 2026  ·  Author: HT99 Tools Editorial Team