title: substract month from timestamp in second
body: <p>I would like to substract months from a timestamp in second.  Here is what I'm doing:</p>
  
  <pre><code>&gt;&gt;&gt; ts = 1454284800
  &gt;&gt;&gt; date_object = datetime.datetime.strptime(time.strftime('%Y%m%d', time.gmtime(1454284800)), '%Y%m%d')
  &gt;&gt;&gt; date_object
  datetime.datetime(2016, 2, 1, 0, 0)
  &gt;&gt;&gt; date_substract = date_object - datetime.timedelta(9*365/12.0)
  &gt;&gt;&gt; date_substract
  datetime.datetime(2015, 5, 3, 6, 0)
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>It depends on the value for the number of months I want to substract, but for 9 months for exemple, days datetime.datetime(2015, 5, 3, <strong>6</strong>, 0) are wrong.  Is there a better way to substract months, which would only change number of months and not days as well.</p>
  
  <p>Thanks in advance.</p>