summaryrefslogtreecommitdiffstats
path: root/Doc/library/datetime.rst
diff options
context:
space:
mode:
authorKabir Kwatra <kabir@kwatra.me>2022-05-03 22:14:25 (GMT)
committerGitHub <noreply@github.com>2022-05-03 22:14:25 (GMT)
commit48c6165c28dfb40eafd2fa6de9bebd14fbc7c95c (patch)
tree877ad0238cb76142bbbc27318b7ed71fd72c56cc /Doc/library/datetime.rst
parentee2205b208389611e8a278ac1bc74b34f4994fd2 (diff)
downloadcpython-48c6165c28dfb40eafd2fa6de9bebd14fbc7c95c.zip
cpython-48c6165c28dfb40eafd2fa6de9bebd14fbc7c95c.tar.gz
cpython-48c6165c28dfb40eafd2fa6de9bebd14fbc7c95c.tar.bz2
gh-91928: Add `datetime.UTC` alias for `datetime.timezone.utc` (GH-91973)
### fixes #91928 `UTC` is now module attribute aliased to `datetime.timezone.utc`. You can now do the following: ```python from datetime import UTC ```
Diffstat (limited to 'Doc/library/datetime.rst')
-rw-r--r--Doc/library/datetime.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index f447b7b..ca17dc8 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -84,6 +84,12 @@ The :mod:`datetime` module exports the following constants:
The largest year number allowed in a :class:`date` or :class:`.datetime` object.
:const:`MAXYEAR` is ``9999``.
+.. attribute:: UTC
+
+ Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`.
+
+ .. versionadded:: 3.11
+
Available Types
---------------