Date & time

Add or Subtract a Date

Move a calendar date by an integer number of days, weeks, months or years. Month and year operations use calendar components and visibly clamp an unavailable day to the last valid day of the destination month.

● Runs locally
Example values
Runs in your browser · No account required

Add or Subtract a Date

Resulting calendar date
01

Formula

result = start ± calendar amount (clamp invalid month days)

Days and weeks move by fixed calendar-day indexes. Months and years change components, then clamp the source day if the destination month is shorter.

02

Assumptions

  • The Gregorian calendar and clamp-to-last-valid-day policy are used.
  • Month operations are not always reversible after a clamp.

One week is seven calendar days. A month is not converted to a fixed number of days.

03

Formula review

Formula v1.0.0

Reviewed 2026-08-03

CalcFlow engineering review

Worked example

Add or Subtract a Date: Worked example

31 January 2026 plus one calendar month targets February. Because 31 February does not exist, the clamp rule returns 28 February 2026.

Frequently asked questions

Frequently asked questions

Why does 31 January plus one month become 28 February?

February lacks a 31st day, so the published policy clamps to its last valid day.

Is one month treated as 30 days?

No. Month and year operations use calendar components, not fixed durations.

Can adding and subtracting a month change the original day?

Yes. Once a date is clamped in a shorter month, the original larger day is not retained as hidden state.