title: How do I convert a date string containing 7 digits in milliseconds into a date in Python
body: <p>When the milliseonds have 6 digits, %f works, but it throws an error if there are more than 6 digits. I have a temporary solution by hardcoding a 0 for the 7th digit, but is there a better way to do? Currently the below works</p>
  
  <pre><code>print (datetime.datetime.strptime(('2014-11-19 00:00:00.0000000').strip(), '%Y-%m-%d  %H:%M:%S.0%f')).date()
  </code></pre>