title: How do I translate an ISO 8601 datetime string into a Python datetime object?
body: <p>I'm getting a datetime string in a format like "2009-05-28T16:15:00" (this is ISO 8601, I believe). One hackish option seems to be to parse the string using <code>time.strptime</code> and passing the first six elements of the tuple into the datetime constructor, like:</p>
  
  <pre><code>datetime.datetime(*time.strptime("2007-03-04T21:08:12", "%Y-%m-%dT%H:%M:%S")[:6])
  </code></pre>
  
  <p>I haven't been able to find a "cleaner" way of doing this. Is there one?</p>