title: How to convert JSON date & time to Python datetime?
body: <p>I get the date and time as string like <code>2014-05-18T12:19:24+04:00</code></p>
  
  <p>I found <a href="https://stackoverflow.com/questions/10805589/converting-json-date-string-to-python-datetime">another question</a> explaining how to handle dates in UTC timezone (<code>2012-05-29T19:30:03.283Z</code>)</p>
  
  <p>What should I do with <code>+04:00</code> in my case (if I want to store time in UTC timezone in Python)?</p>
  
  <p><strong>Upd</strong>. I've tried to parse it like below:</p>
  
  <pre><code>dt = '2014-05-19T14:48:50+04:00'
  plus_position = dt.find('+') # remove column in the timezone part
  colon_pos = dt.find(':', plus_position)
  dt = dt[:colon_pos] + dt[colon_pos+1:]
  dt = datetime.datetime.strptime(dt, '%Y-%m-%dT%H:%M:%S%z') # '2014-05-19T14:48:50+0400'
  </code></pre>
  
  <p>But it fails - <code>'z' is a bad directive in format '%Y-%m-%dT%H:%M:%S%z'</code></p>