Open Guyw2 opened 3 weeks ago
Well... technically datetime.UTC
is also correct (it's just an alias to datetime.timezone.UTC
) (here datetime.UTC
is the UTC
member of the datetime
module, not the UTC
member of the datetime.datetime
class, which does not exist).
OK, but UTC isn't available on Python 3.8, 3.9 and 3.10 which are still supported:
if sys.version_info >= (3, 11):
UTC: timezone
I believe I had to lookup timezone.utc
because it wasn't suggested by my IDE.
Oh my bad! then it's indeed better to use timezone.utc
in the deprecation message!
Could someone fix the formatting of the issue? The link to the pull request isn't clickable.
Documentation
(A clear and concise description of the issue.)
In the doc-string of the
utcnow()
function, it says: