From d8e1b9ff6c5414e29144182e2457aff234928284 Mon Sep 17 00:00:00 2001 From: sarvaSanjay <111774640+sarvaSanjay@users.noreply.github.com> Date: Fri, 28 Oct 2022 09:19:13 -0400 Subject: [PATCH] DOC: Removed line about %S parses all the way up to nanosecond even if no (#49349) * Removed line about %S parses all the way up to nanosecond even if no decimal place present from docstring * Deleted example code and changed documentation to though note that %f will parse all the way up to nanoseconds * Fixed CI error * Changed to %f * Removed line between format and exact * removed whitespace at end of line * Re-added formatting to %f --- pandas/core/tools/datetimes.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 7791ea804a52a5..22406d2871482f 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -782,15 +782,7 @@ def to_datetime( `strftime documentation `_ for more information on choices, though - note the following differences: - - - :const:`"%f"` will parse all the way - up to nanoseconds; - - - :const:`"%S"` without :const:`"%f"` will capture all the way - up to nanoseconds if present as decimal places, and will also handle - the case where the number of seconds is an integer. - + note that :const:`"%f"` will parse all the way up to nanoseconds. exact : bool, default True Control how `format` is used: @@ -969,13 +961,6 @@ def to_datetime( ... format='%Y-%m-%d %H:%M:%S.%f') Timestamp('2018-10-26 12:00:00.000000001') - :const:`"%S"` without :const:`"%f"` will capture all the way - up to nanoseconds if present as decimal places. - - >>> pd.to_datetime('2017-03-22 15:16:45.433502912', - ... format='%Y-%m-%d %H:%M:%S') - Timestamp('2017-03-22 15:16:45.433502912') - **Non-convertible date/times** If a date does not meet the `timestamp limitations