From 5570ad497ec65506cb41988520e00b0e9b6b9d60 Mon Sep 17 00:00:00 2001 From: Gyubong Date: Fri, 9 Sep 2022 11:51:36 +0900 Subject: [PATCH] Add `UTC` alias --- Lib/datetime.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/datetime.py b/Lib/datetime.py index d087c9852c..353e48b68c 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -5,7 +5,7 @@ """ __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", - "MINYEAR", "MAXYEAR") + "MINYEAR", "MAXYEAR", "UTC") import time as _time @@ -2298,7 +2298,7 @@ def _name_from_offset(delta): return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}' return f'UTC{sign}{hours:02d}:{minutes:02d}' -timezone.utc = timezone._create(timedelta(0)) +UTC = timezone.utc = timezone._create(timedelta(0)) # bpo-37642: These attributes are rounded to the nearest minute for backwards # compatibility, even though the constructor will accept a wider range of # values. This may change in the future.