FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-57095: Add note about input splitting in `datetime.*.strptime` (GH-131049) by miss-islington · Pull Request #144734 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions Doc/library/datetime.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,12 @@ For the :meth:`.datetime.strptime` class method, the default value is
``1900-01-01T00:00:00.000``: any components not specified in the format string
will be pulled from the default value.

.. note::
Format strings without separators can be ambiguous for parsing. For
example, with ``%Y%m%d``, the string ``2026111`` may be parsed either as
``2026-11-01`` or as ``2026-01-11``.
Use separators to ensure the input is parsed as intended.

.. note::
When used to parse partial dates lacking a year, :meth:`.datetime.strptime`
will raise when encountering February 29 because the default year of 1900 is
Expand Down
Loading

Back | FazBrowse Home | New Git URL