title: Converting a formatted time string to milliseconds
body: <p>I am trying to convert <code>'2015-09-15T17:13:29.380Z'</code> to milliseconds.</p>
  
  <p>At first I used:</p>
  
  <pre><code>time.mktime(
    datetime.datetime.strptime(
      "2015-09-15T17:13:29.380Z",
      "%Y-%m-%dT%H:%M:%S.%fZ"
    ).timetuple()
  )
  </code></pre>
  
  <p>I got <code>1442330009.0</code> - with no microseconds.  I think <code>time.mktime</code> rounds the number to the nearest second.</p>
  
  <p>In the end I did:</p>
  
  <pre><code>origTime = '2015-09-15T17:13:29.380Z'
  tupleTime = datetime.datetime.strptime(origTime, "%Y-%m-%dT%H:%M:%S.%fZ")
  microsecond = tupleTime.microsecond
  updated = float(time.mktime(tupleTime.timetuple())) + (microsecond * 0.000001)
  </code></pre>
  
  <p>Is there a <strong>better way to do this</strong> and how do I <strong>work with the timezone</strong>?</p>