title: python - Difference between two unix timestamps
body: <p>I have two timestamps in miliseconds and i want to compute the difference between the two in minutes: </p>
  
  <pre><code>d1 = 1502053449617 
  
  current_time_utc = int(round(time.time() * 1000))
  </code></pre>
  
  <p>The values for d1 are dynamically generated by a third party API and are in UTC  . I am trying to get the difference between the current time in UTC and d1.</p>
  
  <pre><code>fmt = '%Y-%m-%d %H:%M:%S'
  
   time1  = datetime.strptime(d1, fmt)
   time2  = datetime.strptime(current_time_utc, fmt)
  </code></pre>
  
  <p>I want to be able to find the difference between the two (time1 - time2) . If i do the below , i get an error saying "string expected, long given" </p>
  
  <pre><code>print(    time1-time2)
  </code></pre>
  
  <p>I want the difference between the two in minutes . Please help</p>