N Monate zu einem Datum mit arrow in Python hinzufügen

Bei einem Datum wie

add_n_months_arrow.py
import arrow

dt = arrow.get("2021-05-27")

können N Monate (Beispiel: 18 Monate) zu diesem Datum hinzugefügt werden mit

add_n_months_arrow_shift.py
dt.shift(months=+18)

Das Ergebnis ist eine arrow-Darstellung von 2022-11-27


Check out similar posts by category: Python