title: How to calculate diff between two dates in django
body: <p>I want to calculate days difference between current date and  previous date.
  i am trying this code</p>
  
  <pre><code>requiremntObj = CustomerLeads.objects.all()
  a = datetime.datetime.now().date()
  
  for i in requiremntObj:
      date1=i.posting_date
      diff = a-date1
      print diff
  </code></pre>
  
  <p>I got a error <code>unsupported operand type(s) for -: 'datetime.date' and 'unicode'</code></p>
  
  <p>For current date i am getting datetime object and for date1 i am getting unicode.</p>
  
  <pre><code>posting_date = models.DateField()
  </code></pre>