Skip to content

Commit

Permalink
Merge pull request #2700 from tdadela/replace-utcfromtimestamp-with-f…
Browse files Browse the repository at this point in the history
…romtimestamp

refactor: replace deprecated utcfromtimestamp function
  • Loading branch information
cyberw committed May 5, 2024
2 parents eb95466 + 12cffb8 commit a04ab14
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 a04ab14

Please sign in to comment.