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

Commit

Permalink
chore(samples): use timezone aware datetimes (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Aug 31, 2021
1 parent 65b61cb commit 0a9ce1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion samples/snippets/batch_write_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
start_time = end_time - datetime.timedelta(seconds=5)

# Create a single span
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/create_span_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
def test_get_trace():
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)
start_time = end_time - datetime.timedelta(seconds=5)

span = create_span.create_span(
Expand Down

0 comments on commit 0a9ce1b

Please sign in to comment.