pythondatetimearrow-python

How to increment a date using Arrow?


I'm using the arrow module to handle datetime objects in Python. If I get current time like this:

now = arrow.now()

...how do I increment it by one day?


Solution

  • Update as of 2020-07-28

    Increment the day

    now.shift(days=1)
    

    Decrement the day

    now.shift(days=-1)
    

    Original Answer

    DEPRECATED as of 2019-08-09

    https://arrow.readthedocs.io/en/stable/releases.html

    Increment the day

    now.replace(days=1)
    

    Decrement the day

    now.replace(days=-1)
    

    I highly recommend the docs.