title: Fastest way to parse a date string with a known format
body: <p>Let's say I have a string in the following format:</p>
  
  <pre><code>"YYYY mm dd"
  </code></pre>
  
  <p>What would be the fastest way to get it into a python date object? My first thought was:</p>
  
  <pre><code>&gt;&gt;&gt; import datetime
  &gt;&gt;&gt; datetime.datetime.strptime('2018 01 12', "%Y %m %d").date()
  datetime.date(2018, 1, 12)
  </code></pre>
  
  <p>However, I have about a million date-strings I need to convert, and was wondering if anyone had alternative methods that may be even faster, or benchmarks showing that the above would be the fastest.</p>