Skip to content

Commit

Permalink
Merge pull request #2738 from JavierUhagon/fixdeprecationtimestamp
Browse files Browse the repository at this point in the history
Modify timestamp generation to remove deprecation warning
  • Loading branch information
cyberw authored May 27, 2024
2 parents a5f2809 + 2316e1a commit c6665d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/util/date.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from datetime import datetime, timezone


def format_utc_timestamp(unix_timestamp):
return datetime.utcfromtimestamp(unix_timestamp).strftime("%Y-%m-%dT%H:%M:%SZ")
return datetime.fromtimestamp(unix_timestamp, timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")

0 comments on commit c6665d4

Please sign in to comment.