title: `datetime.strftime` and `datetime.strptime` interprete %Y differently
body: <p>I use a statement as shown below to create a <code>datetime</code> object from a string:</p>
  
  <p><code>t = datetime.strptime("0023-10-10", "%Y-%m-%d")</code></p>
  
  <p>Later, somewhere in my code uses the <code>t</code> object and invoke the <code>strftime</code> method with the same format string:</p>
  
  <p><code>t.strftime("%Y-%m-%d")</code></p>
  
  <p>This causes a <code>ValueError: year=23 is before 1900; the datetime strftime() methods require year &gt;= 1900</code>.</p>
  
  <p>It seems that the validation of the %Y input is different in this two similar methods.
  So I have to do the following to make sure I don't accept some bad years like <code>23</code>:</p>
  
  <pre><code>try:
      format = "%Y-%m-%d"
      t = datetime.strptime("0023-10-10", format)
      t.strftime(format)
  except ValueError:
      ...
  </code></pre>
  
  <p>I wonder if there's a better way to do this validation.</p>