title: datetime from string with flexible string format
body: <p>I'm parsing date time from string in Python. I like the fact that in pandas, I can define 1 single format, but pandas still allows me to be flexible in my input. As follows</p>
  
  <pre><code>&gt;&gt;&gt; format = '%Y%m%d %H:%M:%S.%f'
  &gt;&gt;&gt; pd.to_datetime('20200106 23:00', format=format)
  Timestamp('2020-01-06 23:00:00')          ## OK
  &gt;&gt;&gt; pd.to_datetime('20200106 23:00:00', format=format)
  Timestamp('2020-01-06 23:00:00')          ## OK
  &gt;&gt;&gt; pd.to_datetime('20200106 23:00:00.000', format=format)
  Timestamp('2020-01-06 23:00:00')          ## still ok
  </code></pre>
  
  <p>With Pandas, I can accept user input that looks like <code>%H:%M</code> or <code>%H:%M:%S</code>, or <code>%H:%M:S.%f</code>. As long as it doesn't violate the original format, it's fine. I like this flexibility. </p>
  
  <p>Does that same behavior exist in datetime?</p>
  
  <pre><code>&gt;&gt;&gt; datetime.strptime('20200106 23:00:00.000000', format)
  datetime.datetime(2020, 1, 6, 23, 0)                 ## OK
  &gt;&gt;&gt; datetime.strptime('20200106 23:00:00', format)   ## NOT OK
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib64/python3.6/_strptime.py", line 565, in _strptime_datetime
      tt, fraction = _strptime(data_string, format)
    File "/usr/lib64/python3.6/_strptime.py", line 362, in _strptime
       (data_string, format))
  ValueError: time data '20200106 23:00:00' does not match format '%Y%m%d %H:%M:%S.%f'
  </code></pre>
  
  <p>strptime doesn't like it. What am I supposed to do? List <em>all</em> formats that user might put in? And do a bunch of tries?</p>