Skip to content
Merged
Changes from all 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
gh-124832: Add a note to indicate that datetime.now may return the …
…same instant (GH-124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

* Update Doc/library/datetime.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------

(cherry picked from commit 760b1e1)

Co-authored-by: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
3 people authored and miss-islington committed Oct 8, 2024
commit fac7a3e0627df39b3784c25431db50267b3dfc28
4 changes: 4 additions & 0 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,10 @@ Other constructors, all class methods:

This function is preferred over :meth:`today` and :meth:`utcnow`.

.. note::

Subsequent calls to :meth:`!datetime.now` may return the same
instant depending on the precision of the underlying clock.

.. classmethod:: datetime.utcnow()

Expand Down