Skip to content

Commit

Permalink
Specify the timezone in timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
ares committed Mar 23, 2021
1 parent 19fe3f4 commit 4a1921c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/callback/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ def get_time():
def get_now():
"""
Return the current timestamp as a string to be sent over the network.
The time is always in UTC timezone and printed in a format Ruby
DateTime can easily parse.
"""
return datetime.utcnow().isoformat()
return datetime.datetime.now(datetime.timezone.utc).isoformat(sep=" ", timespec="seconds")


class CallbackModule(CallbackBase):
Expand Down

0 comments on commit 4a1921c

Please sign in to comment.