title: Convert to UTC Timestamp
body: <pre><code># parses some string into that format.
  datetime1 = datetime.strptime(somestring, &quot;%Y-%m-%dT%H:%M:%S&quot;)
  
  # gets the seconds from the above date.
  timestamp1 = time.mktime(datetime1.timetuple())
  
  # adds milliseconds to the above seconds.
  timeInMillis = int(timestamp1) * 1000
  </code></pre>
  <p>How do I (at any point in that code) turn the date into UTC format? I've been ploughing through the API for what seems like a century and cannot find anything that I can get working. Can anyone help? It's currently turning it into Eastern time i believe (however I'm in GMT but want UTC).</p>
  <p>EDIT: I gave the answer to the guy with the closest to what I finally found out.</p>
  <pre><code>datetime1 = datetime.strptime(somestring, someformat)
  timeInSeconds = calendar.timegm(datetime1.utctimetuple())
  timeInMillis = timeInSeconds * 1000
  </code></pre>
  <p>:)</p>