Skip to content

Commit

Permalink
refactor: replace deprecated datetime.datetime.utcfromtimestamp with …
Browse files Browse the repository at this point in the history
…datetime.datetime.fromtimestamp
  • Loading branch information
tdadela committed May 5, 2024
1 parent 9417953 commit 12cffb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def get_html_report(
stats = environment.runner.stats

start_ts = stats.start_time
start_time = datetime.datetime.utcfromtimestamp(start_ts).strftime("%Y-%m-%d %H:%M:%S")
start_time = datetime.datetime.fromtimestamp(start_ts, tz=datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S")

if end_ts := stats.last_request_timestamp:
end_time = datetime.datetime.utcfromtimestamp(end_ts).strftime("%Y-%m-%d %H:%M:%S")
end_time = datetime.datetime.fromtimestamp(end_ts, tz=datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
else:
end_time = start_time

Expand Down

0 comments on commit 12cffb8

Please sign in to comment.