-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use utcnow instead of now #4192
Conversation
Codecov Report
|
1 similar comment
Codecov Report
|
Codecov Report
|
@@ -34,7 +34,7 @@ def __init__(self, name, init_config, agentConfig, instances=None): | |||
|
|||
def check(self, instance): | |||
self.log.info("Starting Cisco Check") | |||
start = datetime.datetime.now() | |||
start = datetime.datetime.utcnow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case is a bit irrelevant because it is just used to calculate a time delta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might prevent the edge case when we have a DST change on local machine between start
and end
, we might not have the right delta.
What does this PR do?
Use
utcnow
instead ofnow
to avoid possible DST and timezone issues.Motivation
Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached