# Bug report ### Bug description: Subsequent `datetime.now()` may return the same moment in time. ```python from datetime import datetime, UTC now1 = datetime.now(UTC) for i in range(10_000): a = i now2 = datetime.now(UTC) assert now1 < now2 ``` ``` assert now1 < now2 ^^^^^^^^^^^ AssertionError ``` This does seem to work as expected: ```python from time import sleep from datetime import datetime, UTC now1 = datetime.now(UTC) sleep(0.000_000_001) now2 = datetime.now(UTC) assert now1 < now2 ``` I'm not sure if this is a bug, but at least it's a documentation issue. There's nothing in the [docs](https://docs.python.org/3/library/datetime.html#datetime.datetime.now) explicitly indicating this behavior. ### CPython versions tested on: 3.12 ### Operating systems tested on: Windows <!-- gh-linked-prs --> ### Linked PRs * gh-124834 * gh-125145 * gh-125146 <!-- /gh-linked-prs -->
Bug report
Bug description:
Subsequent
datetime.now()may return the same moment in time.This does seem to work as expected:
I'm not sure if this is a bug, but at least it's a documentation issue.
There's nothing in the docs explicitly indicating this behavior.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
datetime.nowmay return the same instant #124834datetime.nowmay return the same instant (GH-124834) #125145datetime.nowmay return the same instant (GH-124834) #125146