title: How to calculate date and time accurately in python?
body: <p>I used this code to calculate date and time:</p>
  
  <pre><code>`from datetime import timedelta
  
  date0 =  datetime.strptime('30/01/17 15:00:00', '%d/%m/%y %H:%M:%S')
  date1 = datetime.strptime('31/01/17 10:30:00', '%d/%m/%y %H:%M:%S')
  date2 = datetime.strptime('03/02/17 01:20:00', '%d/%m/%y %H:%M:%S') 
  
      #======Time================
  
  delta = (date1 - date0).days
  delta1 = (date2 - date0).days
  
  
  
  TOT = (delta1 - delta)*24 
  print TOT`
  </code></pre>
  
  <p>However, it is only calculate the date without time.</p>
  
  <p>please help me.</p>
  
  <p>thank you</p>