Skip to content

Commit cb42e05

Browse files
authored
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
1 parent a393c98 commit cb42e05

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

pandas/core/tools/datetimes.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -782,15 +782,7 @@ def to_datetime(
782782
`strftime documentation
783783
<https://docs.python.org/3/library/datetime.html
784784
#strftime-and-strptime-behavior>`_ for more information on choices, though
785-
note the following differences:
786-
787-
- :const:`"%f"` will parse all the way
788-
up to nanoseconds;
789-
790-
- :const:`"%S"` without :const:`"%f"` will capture all the way
791-
up to nanoseconds if present as decimal places, and will also handle
792-
the case where the number of seconds is an integer.
793-
785+
note that :const:`"%f"` will parse all the way up to nanoseconds.
794786
exact : bool, default True
795787
Control how `format` is used:
796788
@@ -969,13 +961,6 @@ def to_datetime(
969961
... format='%Y-%m-%d %H:%M:%S.%f')
970962
Timestamp('2018-10-26 12:00:00.000000001')
971963
972-
:const:`"%S"` without :const:`"%f"` will capture all the way
973-
up to nanoseconds if present as decimal places.
974-
975-
>>> pd.to_datetime('2017-03-22 15:16:45.433502912',
976-
... format='%Y-%m-%d %H:%M:%S')
977-
Timestamp('2017-03-22 15:16:45.433502912')
978-
979964
**Non-convertible date/times**
980965
981966
If a date does not meet the `timestamp limitations

0 commit comments

Comments
 (0)