title: Datetime pattern does not match in python even though bash recognizes it
body: <p>I have the following code (based on <a href="http://strftime.org/" rel="noreferrer">http://strftime.org/</a>):</p>
  
  <pre><code>try:
      datetime.datetime.strptime("Apr 14, 2016 9", '%b %d, %Y %-I')
      print "matched date format"
  except ValueError:
      print "did NOT match date format"
  </code></pre>
  
  <p>The above prints:</p>
  
  <pre><code>$ python parse_log.py
  did NOT match date format
  </code></pre>
  
  <p>However bash recognizes this date format:</p>
  
  <pre><code>$ date  '+%b %d, %Y %-I'
  Apr 14, 2016 1
  </code></pre>
  
  <p>What am I missing?  </p>
  
  <p>It seems that the %-I is the problem, since Python matches date without the %-I section:</p>
  
  <pre><code>try:
      datetime.datetime.strptime("Apr 14, 2016 ", '%b %d, %Y ')
      print "matched date format"
  except ValueError:
      print "did NOT match date format"
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>$ python parse_log.py
  matched date format
  </code></pre>
  
  <p>I'm on python 2.6.6.</p>
  
  <p>The actual pattern I need to match uses 12 hour clock and is:</p>
  
  <pre><code>datetime.datetime.strptime("Apr 14, 2016 9:59:54", '%b %d, %Y %-I:%M:%S')
  </code></pre>