From d144a5e9f91fac5306fbbe1e0946b2211c990118 Mon Sep 17 00:00:00 2001 From: Aidan Montare Date: Sat, 20 Jun 2020 08:57:52 -0400 Subject: [PATCH 1/2] DOC: add note about the values of unit for pd.to_datetime --- doc/source/user_guide/timeseries.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/user_guide/timeseries.rst b/doc/source/user_guide/timeseries.rst index 648d93a45d210..d3e4961a42c88 100644 --- a/doc/source/user_guide/timeseries.rst +++ b/doc/source/user_guide/timeseries.rst @@ -319,6 +319,11 @@ which can be specified. These are computed from the starting point specified by pd.to_datetime([1349720105100, 1349720105200, 1349720105300, 1349720105400, 1349720105500], unit='ms') +.. note:: + + The strings used to specify a ``unit`` are not the same are those by ``format``. + The available units are listed on the documentation for :func:`pandas.to_datetime`. + Constructing a :class:`Timestamp` or :class:`DatetimeIndex` with an epoch timestamp with the ``tz`` argument specified will currently localize the epoch timestamps to UTC first then convert the result to the specified time zone. However, this behavior From 5e8ab3c22db6fb233bf298367d5747474358f55e Mon Sep 17 00:00:00 2001 From: Aidan Montare Date: Sat, 20 Jun 2020 12:03:16 -0400 Subject: [PATCH 2/2] DOC: clarified note on units argument --- doc/source/user_guide/timeseries.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/timeseries.rst b/doc/source/user_guide/timeseries.rst index d3e4961a42c88..a03ba6c775e68 100644 --- a/doc/source/user_guide/timeseries.rst +++ b/doc/source/user_guide/timeseries.rst @@ -235,6 +235,8 @@ inferred frequency upon creation: pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05'], freq='infer') +.. _timeseries.converting.format: + Providing a format argument ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -321,8 +323,9 @@ which can be specified. These are computed from the starting point specified by .. note:: - The strings used to specify a ``unit`` are not the same are those by ``format``. - The available units are listed on the documentation for :func:`pandas.to_datetime`. + The ``unit`` parameter does not use the same strings as the ``format`` parameter + that was discussed :ref:`above`). The + available units are listed on the documentation for :func:`pandas.to_datetime`. Constructing a :class:`Timestamp` or :class:`DatetimeIndex` with an epoch timestamp with the ``tz`` argument specified will currently localize the epoch timestamps to UTC