diff options
author | Gua Guo <gua.guo@intel.com> | 2024-04-21 20:44:55 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-04-26 03:01:55 +0000 |
commit | c0dfe3ec1f364dbdaf6b241e01343e560b21dd03 (patch) | |
tree | 2d18ff902d962fa6ae35c90f8a2f495112962e16 | |
parent | 66c24219ade92b85b24f3ce29b988d187a9f6517 (diff) | |
download | edk2-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>
-rw-r--r-- | BaseTools/Scripts/GetUtcDateTime.py | 2 |
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))
|