title: How to calculate the difference between dates in python
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/441147/how-can-i-subtract-a-day-from-a-python-date">How can I subtract a day from a python date?</a><br>
    <a href="https://stackoverflow.com/questions/5259882/subtract-two-times-in-python">subtract two times in python</a>  </p>
  </blockquote>
  
  
  
  <p>I had generated date in python as below</p>
  
  <pre><code>import time
  time_stamp = time.strftime('%Y-%m-%d')
  
  print time_stamp
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>'2012-12-19'
  </code></pre>
  
  <p>What i am trying is, if above time_stamp is the present today's date , i want a date <code>'2012-12-17'</code> by performing difference(substraction of two days)</p>
  
  <p>So how to perform date reduction of two days from the current date in python </p>