Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

chore(samples): use timezone aware datetimes #121

Merged
merged 4 commits into from
Aug 31, 2021
Merged

Conversation

busunkim96
Copy link
Contributor

@busunkim96 busunkim96 requested a review from a team as a code owner August 17, 2021 19:24
@product-auto-label product-auto-label bot added the api: cloudtrace Issues related to the googleapis/python-trace API. label Aug 17, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 17, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Aug 17, 2021
Copy link

@engelke engelke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -29,7 +29,7 @@ def batch_write_spans(project_id: str):
trace_id = str(uuid.uuid4()).replace("-", "")
span_id = str(uuid.uuid4()).replace("-", "")[:16]

end_time = datetime.datetime.now()
end_time = datetime.datetime.now(tz=datetime.timezone.utc)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. You could also have replaced the old datetime.now() with datetime.utcnow().

@busunkim96 busunkim96 added the automerge Merge the pull request once unit tests and other checks pass. label Aug 31, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 0a9ce1b into main Aug 31, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the datetime branch August 31, 2021 15:06
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: cloudtrace Issues related to the googleapis/python-trace API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants