Core answer: Adding days to a date means crossing month and year boundaries correctly: Jan 30 + 5 days = Feb 4 (not "Jan 35"). Adding MONTHS is trickier — Jan 31 + 1 month = Feb 28/29 (clamp to month end); adding years hits leap day: Feb 29, 2024 + 1 year = Feb 28, 2025. Rules: days add arithmetically; months/years clamp to the target month's last valid day.

The three addition modes

ModeRuleExample
+ dayspure arithmetic, cross months2025-01-30 + 5 d = 2025-02-04
+ monthssame day-of-month, clamp if needed2025-01-31 + 1 mo = 2025-02-28
+ yearssame date, clamp Feb 292024-02-29 + 1 y = 2025-02-28

Month lengths: 31, 28/29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. Leap years (÷4, except ÷100 unless ÷400) give February 29.

Worked examples

Example 1 — 90-day warranty. Purchase on 2025-03-05: +90 days. March remaining: 26, April 30, May 31 → 26+30+31 = 87, need 3 more → warranty ends 2025-06-03.

Example 2 — 6-month visa. Entry on 2025-08-31 + 6 months = 2026-02-28 (clamped from Feb 31). Overstay math must use the clamped date, not "Feb 31".

Example 3 — Contract anniversaries. Lease signed 2024-02-29 for 2 years → ends 2026-02-28 (both following years clamp; some contracts specify Mar 1 instead — read the clause).

Example 4 — Medicine schedule. "Every 28 days" starting 2025-12-15: 2026-01-12 → 2026-02-09 → 2026-03-09. Weekly-style arithmetic across year boundary without errors.

Example 5 — Countdown planning. 100 days before 2025-12-31: December 30, November 30, October 31 → 30+30+31 = 91, need 9 more → 2025-09-22.

Common mistakes and myths

  1. Treating months as 30 days — 3 months ≠ 90 days (real range: 89–92); contracts written in days avoid the ambiguity.
  2. Forgetting the clamp — "Jan 31 + 1 month" is not an error to throw; standard libraries clamp to Feb 28/29, but some business rules roll FORWARD to Mar 3 — know which one your domain uses.
  3. Leap-day birthdays — celebrating Feb 29 babies on Feb 28 vs Mar 1 is a legal choice that varies by jurisdiction (Taiwan law says Feb 28; New Zealand says Mar 1 for some purposes).
  4. Time-zone date shifts — adding 24 h across a DST boundary can land you at 01:30 or 03:30 local; calendar-day addition should operate on dates, not timestamps.
  5. Inclusive/exclusive ends — "valid for 30 days from Mar 1" ends Mar 30 or Mar 31 depending on whether day 1 counts; airlines and insurers differ, so always state the end date explicitly.