title: How do I prevent pandas.to_datetime() function from converting 0001-01-01 to 2001-01-01
body: <p>I have read-only access to a database that I query and read into a Pandas dataframe using pymssql. One of the variables contains dates, some of which are stored as midnight on 01 Jan 0001 (i.e. 0001-01-01 00:00:00.0000000). I've no idea why those dates should be included – as far as I know, they are not recognised as a valid date by SQL Server and they are probably due to some default data entry. Nevertheless, that's what I have to work with. This can be recreated as a dataframe as follows:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  tempDF = pd.DataFrame({ 'id': [0,1,2,3,4],
                          'date': ['0001-01-01 00:00:00.0000000',
                                   '2015-05-22 00:00:00.0000000',
                                   '0001-01-01 00:00:00.0000000',
                                   '2015-05-06 00:00:00.0000000',
                                   '2015-05-03 00:00:00.0000000']})
  </code></pre>
  
  <p>The dataframe looks like:</p>
  
  <pre><code>print(tempDF)
                            date  id
  0  0001-01-01 00:00:00.0000000   0
  1  2015-05-22 00:00:00.0000000   1
  2  0001-01-01 00:00:00.0000000   2
  3  2015-05-06 00:00:00.0000000   3
  4  2015-05-03 00:00:00.0000000   4
  </code></pre>
  
  <p>... with the following dtypes:</p>
  
  <pre><code>print(tempDF.dtypes)
  
  date    object
  id       int64
  dtype: object
  print(tempDF.dtypes)
  </code></pre>
  
  <p>However, I routinely convert date fields in the dataframe to datetime format using:</p>
  
  <pre><code>tempDF['date'] = pd.to_datetime(tempDF['date'])
  </code></pre>
  
  <p>However, by chance, I've noticed that the 0001-01-01 date is converted to 2001-01-01.</p>
  
  <pre><code>print(tempDF)
  
          date  id
  0 2001-01-01   0
  1 2015-05-22   1
  2 2001-01-01   2
  3 2015-05-06   3
  4 2015-05-03   4
  </code></pre>
  
  <p>I realise that the dates in the original database are incorrect because SQL Server doesn't see 0001-01-01 as a valid date. But at least in the 0001-01-01 format, such missing data are easy to identify within my Pandas dataframe. However, when pandas.to_datetime() changes these dates so they lie within a feasible range, it is very easy to miss such outliers.</p>
  
  <p>How can I make sure that pd.to_datetime doesn't interpret the outlier dates incorrectly?</p>