title: Python 3 time: difference in seconds between two timestamps
body: <p>I have two timestamp strings. I want to find the difference between them in seconds.</p>
  
  <p>I've tried:</p>
  
  <pre><code>from time import gmtime, strptime
  a = "Mon 11 Dec 2017 13:54:36 -0700"
  b = "Mon 11 Dec 2017 13:54:36 -0000"
  
  time1 = strptime(a, "%a %d %b %Y %H:%M:%S %z")
  time2 = strptime(b, "%a %d %b %Y %H:%M:%S %z")
  
  time1-time2
  </code></pre>
  
  <p>Getting an error: TypeError: unsupported operand type(s) for -: 'time.struct_time' and 'time.struct_time'</p>
  
  <p>So, how do I calculate the difference using package time?</p>
  
  <p>I was successful using package datetime - in the code below, but I think I read that datetime ignores seconds in leap years, or something to that effect. Thus, I am trying to use 'time':</p>
  
  <pre><code>from datetime import datetime
  time1 = datetime.strptime(a, "%a %d %b %Y %H:%M:%S %z")
  time2 = datetime.strptime(b, "%a %d %b %Y %H:%M:%S %z")
  dif = time1 - time2
  print(int(dif.total_seconds()))
  </code></pre>
  
  <p>Thank you very much!</p>