title: Python: datetime format
body: <p>I have the following datetime string: </p>
  
  <pre><code>Mon Oct 27 23:00:03 +0000 2014
  </code></pre>
  
  <p>I would like to convert this string to a form where I could compare the datetimes. So, the first thing I tried is converting this to a <code>datetime</code> in Python.</p>
  
  <p>I am having trouble with the correct formatting. I have followed <a href="https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior" rel="nofollow">the documentation</a>, but it does not work.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>str = 'Mon Oct 27 23:00:03 +0000 2014'
  datetime.strptime(str, '%a %b %d %X %Z %Y')
  </code></pre>
  
  <p>How can I get this to work?</p>