mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
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 ```
This commit is contained in:
parent
ee2205b208
commit
48c6165c28
6 changed files with 23 additions and 3 deletions
|
@ -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
|
||||
---------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue