title: Is there a simple way to increment a datetime object one month in Python?
body: <p>So I am trying to find a way to increment a datetime object by one month. However, it seems this is not so simple, according to <a href="https://stackoverflow.com/questions/4130922/how-to-increment-datetime-by-custom-months-in-python-without-using-library">this question</a>. </p>
  
  <p>I was hoping for something like: </p>
  
  <pre><code>import datetime as dt
  
  now = dt.datetime.now()
  later = now + dt.timedelta(months=1)
  </code></pre>
  
  <p>But that doesn't work. I was also hoping to be able to go to the same day (or the closest alternative) in the next month if possible. For example, a datetime object set at January 1st would increment to Feb 1st whereas a datetime object set at February 28th would increment to March 31st as opposed to March 28th or something.  </p>
  
  <p>To be clear, February 28th would (typically) map to March 31st because it is the last day of the month, and thus it should go to the last day of the month for the next month. Otherwise it would be a direct link: the increment should go to the day in the next month with the same numbered day.  </p>
  
  <p>Is there a simple way to do this in the current release of Python?</p>