title: python datetime.strptime: ignore fraction of a second
body: <p>I'm working on converting a human readable time to a <code>datetime</code> object . In order to do this, I'm using <code>datetime.datetime.strptime</code>.</p>
  
  <p>Simple enough, however, the human readable time that I have contains fractions of a second, which I'm not able to parse. If this was a constant, I could incorporate it as part of the format. However, since it is not a constant, I am unable to do so. </p>
  
  <p>This is what I'm doing right now:</p>
  
  <pre><code>&gt;&gt;&gt; humanTime = '2012/06/10T16:36:20.509Z'
  &gt;&gt;&gt; datetime.datetime.strptime(humanTime, "%Y/%m/%dT%H:%M:%SZ")
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "lib/python2.7/_strptime.py", line 325, in _strptime
      (data_string, format))
  ValueError: time data '2012-06-10T16:36:20.507Z' does not match format '%Y-%m-%dT%H:%M:%SZ'
  </code></pre>
  
  <p>So I figure that the issue here is that the fraction of a second is not parseable. I don't really care about that fraction of a second. Short of slicing the string, is there a way by which I can ask <code>datetime</code> to ignore the fraction of a second (preferably with the format)?</p>
  
  <p>I have a feeling that I might be missing something very basic. I'd appreciate any help.</p>