Skip to content

Commit c16ad6b

Browse files
added timestamp limitations and default behavior to docstring
1 parent 0db07b5 commit c16ad6b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/tseries/tools.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,13 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
267267
1 2016-03-05
268268
dtype: datetime64[ns]
269269
270-
If a date that does not meet timestamp limitations, passing errors='coerce'
271-
will force to NaT. Furthermore this will force non-dates to NaT as well.
272-
270+
Since pandas represents timestamps in nanosecond resolution, the timespan that can be represented using a 64-bit integer is limited to approximately 584 years.
271+
272+
If a date that does not meet timestamp limitations, passing errors='ignore' will simply return the original input instead of raising any exception.
273273
>>> pd.to_datetime('13000101', format='%Y%m%d', errors='ignore')
274274
datetime.datetime(1300, 1, 1, 0, 0)
275+
276+
Passing errors='coerce' will force to NaT. Furthermore this will force non-dates to NaT as well.
275277
>>> pd.to_datetime('13000101', format='%Y%m%d', errors='coerce')
276278
NaT
277279

0 commit comments

Comments
 (0)