Skip to content

Commit

Permalink
timer: use datetime.timezone.utc for python 3.10
Browse files Browse the repository at this point in the history
Python 3.10 doesn't have datetime.UTC yet as Python 3.12 does

Signed-off-by: Kyr Shatskyy <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Aug 4, 2024
1 parent 70d385e commit 5bd83e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion teuthology/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_datetime_string(self, time):
:param time: Time in seconds; like from time.time()
"""
_datetime = datetime.datetime.fromtimestamp(time, datetime.UTC)
_datetime = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
return datetime.datetime.strftime(
_datetime,
self.datetime_format,
Expand Down

0 comments on commit 5bd83e9

Please sign in to comment.