Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-124549: Add a note that when over-specifying datetime format, only the last directive gets used.#125009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Mariatta wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromMariatta:123449-docs-about-dtformat
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletionsDoc/library/datetime.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2761,6 +2761,14 @@ Notes:
:exc:`DeprecationWarning`. In 3.15 or later we may change this into
an error or change the default year to a leap year. See :gh:`70647`.

(11)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is a note here the best place for this?

When parsing a string using :meth:`~.datetime.strptime`, if more than one
directives of the same time unit were used, only the last directive gets parsed
and applied to the datetime object. For example, if the format string contains
both ``%Y`` and ``%y``, like ``%Y%y``, only the last directive on the string (``%y``)
gets used on the resulting datetime object.


.. rubric:: Footnotes

.. [#] If, that is, we ignore the effects of Relativity
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp