From c0dfe3ec1f364dbdaf6b241e01343e560b21dd03 Mon Sep 17 00:00:00 2001 From: Gua Guo Date: Sun, 21 Apr 2024 20:44:55 +0800 Subject: 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 Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Signed-off-by: Gua Guo Reviewed-by: Liming Gao --- BaseTools/Scripts/GetUtcDateTime.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools') 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)) -- cgit v1.2.3