title: Python - Convert February 29 dates to date time objects
body: <p>I need to convert dates in string format to date time object but I keep getting a value error for 29th February dates. Here is my code.</p>
  <pre><code>from datetime import datetime
  
  def try_parsing_date(text):
      for fmt in ('%Y-%m-%d', '%d.%m.%Y', '%m/%d/%Y', '%d/%m/%Y', '%d-%b-%y', '%d/%m/%y', '%m/%d/%y', '%m/%d/%Y'):
          try:
              return datetime.strptime(text, fmt)
          except ValueError:
              pass
      raise ValueError(text)
  
  df['Dateofbirth'] = df.apply(lambda row: try_parsing_date(row['Dateofbirth']), axis=1)
  </code></pre>
  <p>The error I get is <strong>ValueError: ('2/29/57', 'occurred at index 82445')</strong>.</p>
  <p>What is the best way to resolve this issue?</p>