Skip to content

Commit

Permalink
Merge pull request #1918 from uddmorningsun/master
Browse files Browse the repository at this point in the history
Fixed #1909 -- Return UTC datetime with the POSIX timestamp for API /stats/report
  • Loading branch information
cyberw authored Oct 28, 2021
2 parents f2f6b9c + 92fcdc5 commit 57cbee6
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 @@ -20,11 +20,11 @@ def get_html_report(environment, show_download_link=True):
stats = environment.runner.stats

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

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

Expand Down

0 comments on commit 57cbee6

Please sign in to comment.