Skip to content

Commit

Permalink
DOC: Removed line about %S parses all the way up to nanosecond even …
Browse files Browse the repository at this point in the history
…if no (pandas-dev#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
  • Loading branch information
sarvaSanjay authored and noatamir committed Nov 9, 2022
1 parent b3c6bee commit d8e1b9f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pandas/core/tools/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,7 @@ def to_datetime(
`strftime documentation
<https://docs.python.org/3/library/datetime.html
#strftime-and-strptime-behavior>`_ 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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d8e1b9f

Please sign in to comment.