How it works
Days and weeks are added or subtracted as exact day counts. Months and years shift the calendar month/year, keeping the day of month where possible (adjusting for shorter months).
Example
Adding 30 days to January 1 gives January 31. Adding 1 month to January 31 gives February 28 (or 29 in a leap year), since February has fewer days.
Assumptions & limitations
Month/year math follows standard calendar rules, which can shift the day of month near month-end — this matches how most calendar apps behave.
Frequently asked questions
What happens if the resulting day doesn't exist in the target month?
The date rolls to the last valid day of that month, e.g. Jan 31 + 1 month becomes the last day of February.