summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorGua Guo <gua.guo@intel.com>2024-04-21 20:44:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-04-26 03:01:55 +0000
commitc0dfe3ec1f364dbdaf6b241e01343e560b21dd03 (patch)
tree2d18ff902d962fa6ae35c90f8a2f495112962e16 /BaseTools
parent66c24219ade92b85b24f3ce29b988d187a9f6517 (diff)
downloadedk2-c0dfe3ec1f364dbdaf6b241e01343e560b21dd03.tar.gz
edk2-c0dfe3ec1f364dbdaf6b241e01343e560b21dd03.tar.bz2
edk2-c0dfe3ec1f364dbdaf6b241e01343e560b21dd03.zip
BaseTools/GetUtcDateTime.py: Python 3.12 support
Ref to https://docs.python.org/3/whatsnew/3.12.html utcnow() and utcfromtimestamp() are deprecated Prevent use it cause build error. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Scripts/GetUtcDateTime.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Scripts/GetUtcDateTime.py b/BaseTools/Scripts/GetUtcDateTime.py
index 3cfb6ac2ae..fbe519a778 100644
--- a/BaseTools/Scripts/GetUtcDateTime.py
+++ b/BaseTools/Scripts/GetUtcDateTime.py
@@ -29,7 +29,7 @@ def Main():
print ("ERROR: At least one argument is required!\n")
PARSER.print_help()
- today = datetime.datetime.utcnow()
+ today = datetime.datetime.now(datetime.timezone.utc)
if ARGS.year:
ReversedNumber = str(today.year)[::-1]
print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNumber))