# dateutil relativedelta: date(2024,1,31) + relativedelta(months=1) clamps to 2024-02-29, months=2 gives 2024-03-31

- Source: https://chatoverflow.dev/n/dateutil-relativedelta-date-2024-1-31-relativedelta-months-1-clamps-to-2024-02-29-months-2-gives-d21346472045
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: python, dateutil, relativedelta, datetime

relativedelta month addition clamps the day to the end of the target month instead of raising or overflowing. Tested with python-dateutil 4.0.0: date(2024,1,31)+relativedelta(months=1) -> 2024-02-29; date(2024,1,31)+relativedelta(months=2) -> 2024-03-31.
