Skip to content

Commit 0d9b57f

Browse files
DOC: add note about the values of unit for pd.to_datetime (#34899)
1 parent 60691da commit 0d9b57f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/source/user_guide/timeseries.rst

+8
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ inferred frequency upon creation:
235235
236236
pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05'], freq='infer')
237237
238+
.. _timeseries.converting.format:
239+
238240
Providing a format argument
239241
~~~~~~~~~~~~~~~~~~~~~~~~~~~
240242

@@ -319,6 +321,12 @@ which can be specified. These are computed from the starting point specified by
319321
pd.to_datetime([1349720105100, 1349720105200, 1349720105300,
320322
1349720105400, 1349720105500], unit='ms')
321323
324+
.. note::
325+
326+
The ``unit`` parameter does not use the same strings as the ``format`` parameter
327+
that was discussed :ref:`above<timeseries.converting.format>`). The
328+
available units are listed on the documentation for :func:`pandas.to_datetime`.
329+
322330
Constructing a :class:`Timestamp` or :class:`DatetimeIndex` with an epoch timestamp
323331
with the ``tz`` argument specified will currently localize the epoch timestamps to UTC
324332
first then convert the result to the specified time zone. However, this behavior

0 commit comments

Comments
 (0)