title: Convert timestamps with offset to datetime obj using strptime
body: <p>I am trying to convert time-stamps of the format "2012-07-24T23:14:29-07:00" 
  to datetime objects in python using strptime method. The problem is with the time offset at the end(-07:00). Without the offset i can successfully do</p>
  
  <pre><code>time_str = "2012-07-24T23:14:29"
  
  time_obj=datetime.datetime.strptime(time_str,'%Y-%m-%dT%H:%M:%S')
  </code></pre>
  
  <p>But with the offset i tried</p>
  
  <pre><code>time_str = "2012-07-24T23:14:29-07:00"
  
  time_obj=datetime.datetime.strptime(time_str,'%Y-%m-%dT%H:%M:%S-%z').
  </code></pre>
  
  <p>But it gives a Value error saying "z" is a bad directive.</p>
  
  <p>Any ideas for a work around?</p>