title: python convert PST time to UTC isoformat
body: <p>ex:
  I have a date string</p>
  
  <pre><code>2018-02-17 16:15:36.519 PST
  </code></pre>
  
  <p>How do i convert into isoformat in UTC like below</p>
  
  <pre><code>2018-02-18T00:15:36.519Z
  </code></pre>
  
  <p>I tried this</p>
  
  <pre><code>from dateutil.parser import parse
  d1='2018-02-17 16:15:36.519 PST'
  print parse(d1)
  it prints like this.  How do i convert it to UTC with Z at the end.
  2018-02-17 16:15:36.519000-08:00
  </code></pre>
  
  <p><strong><em>EDIT</em></strong>
  using python 2.7.  </p>
  
  <pre><code>import dateutil
  import pytz
  from dateutil.parser import parse
  d1='2018-02-17 16:15:36.519 PST'
  d2=dateutil.parser.parse(d1)
  d2.replace(tzinfo=pytz.utc) - d2.utcoffset()
  d3=(d2.replace(tzinfo=pytz.utc) - d2.utcoffset()).isoformat()
  print d3
  </code></pre>
  
  <p>then formatting with Z as suggested</p>