title: Subtracting n days from date in Python
body: <p>I want to subtract n days from a file's timestamp, but it doesn't seem to be working. I have read <a href="https://stackoverflow.com/questions/6871016/adding-5-days-to-date-in-python">this post</a>, and I think I'm close.</p>
  
  <p>This is an excerpt from my code:</p>
  
  <pre><code>import os, time
  from datetime import datetime, timedelta
  
  def processData1( pageFile ):
      f = open(pageFile, "r")
      page = f.read()
      filedate = time.strftime('%m/%d/%Y', time.gmtime(os.path.getmtime(pageFile)))
      print filedate
      end_date = filedate - datetime.timedelta(days=10)
      print end_date
  </code></pre>
  
  <p>Printing <code>filedate</code> works, so that date is read correctly from the files. It's the subtraction bit that doesn't seem to be working.</p>
  
  <p>Desired output:
  If <code>filedate</code> is 06/11/2013, <code>print end_date</code> should yield <code>06/01/2013</code>.</p>