<h4 dir="auto">Code Sample</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pd.DataFrame({&quot;date&quot;: ['10000101', '20180220']})

# Timestamp limitations correctly raise exception
pd.to_datetime(df.date, errors='raise')
...
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1000-01-01 00:00:00

# Timestamp limitations correctly coerce to NaT
pd.to_datetime(df.date, errors='coerce')
...
0          NaT
1   2018-02-20
Name: date, dtype: datetime64[ns]

# errors=`ignore` incorrectly results in datetime like object
pd.to_datetime(df.date, errors='ignore', format=&quot;%Y%m%d&quot;)
0    1000-01-01 00:00:00
1    2018-02-20 00:00:00
Name: date, dtype: object"><pre class="notranslate"><span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">"date"</span>: [<span class="pl-s">'10000101'</span>, <span class="pl-s">'20180220'</span>]})

<span class="pl-c"># Timestamp limitations correctly raise exception</span>
<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">df</span>.<span class="pl-s1">date</span>, <span class="pl-s1">errors</span><span class="pl-c1">=</span><span class="pl-s">'raise'</span>)
...
<span class="pl-v">OutOfBoundsDatetime</span>: <span class="pl-v">Out</span> <span class="pl-s1">of</span> <span class="pl-s1">bounds</span> <span class="pl-s1">nanosecond</span> <span class="pl-s1">timestamp</span>: <span class="pl-c1">1000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span>

<span class="pl-c"># Timestamp limitations correctly coerce to NaT</span>
<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">df</span>.<span class="pl-s1">date</span>, <span class="pl-s1">errors</span><span class="pl-c1">=</span><span class="pl-s">'coerce'</span>)
...
<span class="pl-c1">0</span>          <span class="pl-v">NaT</span>
<span class="pl-c1">1</span>   <span class="pl-c1">2018</span><span class="pl-c1">-</span><span class="pl-c1">02</span><span class="pl-c1">-</span><span class="pl-c1">20</span>
<span class="pl-v">Name</span>: <span class="pl-s1">date</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">datetime64</span>[<span class="pl-s1">ns</span>]

<span class="pl-c"># errors=`ignore` incorrectly results in datetime like object</span>
<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">df</span>.<span class="pl-s1">date</span>, <span class="pl-s1">errors</span><span class="pl-c1">=</span><span class="pl-s">'ignore'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">"%Y%m%d"</span>)
<span class="pl-c1">0</span>    <span class="pl-c1">1000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span>
<span class="pl-c1">1</span>    <span class="pl-c1">2018</span><span class="pl-c1">-</span><span class="pl-c1">02</span><span class="pl-c1">-</span><span class="pl-c1">20</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span>
<span class="pl-v">Name</span>: <span class="pl-s1">date</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">object</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">I believe that when <code class="notranslate">errors='ignore'</code>, and the timestamp limitations are violated by a datum, the result <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.to_datetime.html" rel="nofollow">should be the original input</a> – not a datetime like object.</p>
<h4 dir="auto">Expected Output</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.to_datetime(df.date, errors='ignore', format=&quot;%Y%m%d&quot;)
0    '10000101'
1    2018-02-20 00:00:00
Name: date, dtype: object"><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">df</span>.<span class="pl-s1">date</span>, <span class="pl-s1">errors</span><span class="pl-c1">=</span><span class="pl-s">'ignore'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">"%Y%m%d"</span>)
<span class="pl-c1">0</span>    <span class="pl-s">'10000101'</span>
<span class="pl-c1">1</span>    <span class="pl-c1">2018</span><span class="pl-c1">-</span><span class="pl-c1">02</span><span class="pl-c1">-</span><span class="pl-c1">20</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span>
<span class="pl-v">Name</span>: <span class="pl-s1">date</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">object</span></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.2.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 16.7.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.21.0<br>
pytest: 2.9.2<br>
pip: 9.0.1<br>
setuptools: 27.2.0<br>
Cython: 0.24.1<br>
numpy: 1.11.1<br>
scipy: 0.18.1<br>
pyarrow: None<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: 1.4.6<br>
patsy: 0.4.1<br>
dateutil: 2.5.3<br>
pytz: 2016.6.1<br>
blosc: None<br>
bottleneck: 1.1.0<br>
tables: 3.2.3.1<br>
numexpr: 2.6.1<br>
feather: None<br>
matplotlib: 1.5.3<br>
openpyxl: 2.3.2<br>
xlrd: 1.0.0<br>
xlwt: 1.2.0<br>
xlsxwriter: 0.9.3<br>
lxml: 3.6.4<br>
bs4: 4.5.1<br>
html5lib: None<br>
sqlalchemy: 1.0.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
<p dir="auto">Copying from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="183817974" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14448" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/14448/hovercard?comment_id=255068330&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/issues/14448#issuecomment-255068330">#14448 (comment)</a> (as the issue is closed now):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: pd.to_datetime('13000101', errors='ignore')
Out[1]: '13000101'

In [2]: pd.to_datetime('13000101', errors='ignore', format='%Y%m%d')
Out[2]: datetime.datetime(1300, 1, 1, 0, 0)"><pre class="notranslate"><code class="notranslate">In [1]: pd.to_datetime('13000101', errors='ignore')
Out[1]: '13000101'

In [2]: pd.to_datetime('13000101', errors='ignore', format='%Y%m%d')
Out[2]: datetime.datetime(1300, 1, 1, 0, 0)
</code></pre></div>
<p dir="auto">The above inconsistency (which is also not documented at all I think), is that something we want to fix?</p>