Date arithmetic

Add or subtract dates

Move a date by calendar units. Years are applied first, then months, then weeks and days; invalid month-end dates clamp to that month’s final day.

Result

Tuesday, April 21, 1987

Added to Sunday, March 22, 1987.

ISO date1987-04-21
WeekdayTuesday
Absolute day distance30

Month-end clamping happens after years and again after months. For example, subtracting one month from March 31 lands on February 28 or 29.