From 760b1e103a0aa696cdf448e0d500cd1bac2213fa Mon Sep 17 00:00:00 2001 From: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:17:53 +0200 Subject: [PATCH] gh-124832: Add a note to indicate that `datetime.now` may return the same instant (#124834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update datetime.rst * Update datetime.rst replace warning with note * Update Doc/library/datetime.rst Co-authored-by: Victor Stinner * Update Doc/library/datetime.rst Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --------- Co-authored-by: Victor Stinner Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/datetime.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 64510a77c67..f0b465bc9ce 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -948,6 +948,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()