Skip to content
Snippets Groups Projects
Commit 5a3dee3f authored by jkerdreu's avatar jkerdreu
Browse files

Add support for datetime.UTC mandatory for Python > 3.12

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3218 b32b6428-25c9-4566-ad07-03861ab6144f
parent 3a5d89ba
No related branches found
No related tags found
No related merge requests found
......@@ -323,8 +323,8 @@ def build_nonce(data):
def build_timestamp():
"""Return array [seconds since epoch, microseconds since last seconds] Time = UTC+0000"""
epoch = datetime.datetime.utcfromtimestamp(0)
timestamp = datetime.datetime.utcnow() - epoch
epoch = datetime.datetime.fromtimestamp(0, datetime.UTC)
timestamp = datetime.datetime.now(datetime.UTC) - epoch
return _packtimestamp(timestamp.total_seconds(), timestamp.microseconds)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment