title: 2 digit years using strptime() is not able to parse birthdays very well
body: <p>Consider the following birthdays (as <code>dob</code>):</p>
  
  <ul>
  <li>1-Jun-68</li>
  <li>1-Jun-69</li>
  </ul>
  
  <p>When parsed with Python’s <code>datetime.strptime(dob, '%d-%b-%y')</code> will yield:</p>
  
  <ul>
  <li><code>datetime.datetime(2068, 6, 1, 0, 0)</code></li>
  <li><code>datetime.datetime(1969, 6, 1, 0, 0)</code></li>
  </ul>
  
  <p>Well of course they’re supposed to be born in the same decade but now it’s not even in the same century!</p>
  
  <p>According to the <a href="http://docs.python.org/library/time.html" rel="noreferrer">docs</a> this is perfectly valid behaviour:</p>
  
  <blockquote>
    <p>When 2-digit years are accepted, they are converted according to
    the POSIX or X/Open standard: values 69-99 are mapped to 1969-1999,
    and values 0–68 are mapped to 2000–2068.</p>
  </blockquote>
  
  <p>I understand why the function is set up like this but is there a way to work around this? Perhaps with defining your own ranges for 2-digit years?</p>