title: Find difference between two time strings in Python
body: <p>I have two times in the string format HHMM and I want to find the difference in minutes. </p>
  
  <p>I've tried the below but I'm getting the following error:</p>
  
  <p>TypeError: unsupported operand type(s) for -: 'datetime.time' and 'datetime.time'</p>
  
  <pre><code>import datetime  
  
  a = "0628"
  b = "0728"
  
  aSep = a[:2] + ':' + a[2:]
  bSep = b[:2] + ':' + b[2:]
  
  timeA = datetime.datetime.strptime(aSep, '%H:%M').time()
  timeB = datetime.datetime.strptime(bSep, '%H:%M').time()
  
  diff = timeB -timeA
  print diff
  </code></pre>