Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ab7b9d

Browse files
authored
fix time conversion bug (open-telemetry#182)
1 parent 92353c0 commit 2ab7b9d

File tree

1 file changed

+1
-1
lines changed
  • opentelemetry-sdk/src/opentelemetry/sdk

1 file changed

+1
-1
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ def time_ns():
2626

2727
def ns_to_iso_str(nanoseconds):
2828
"""Get an ISO 8601 string from time_ns value."""
29-
ts = datetime.datetime.fromtimestamp(nanoseconds / 1e9)
29+
ts = datetime.datetime.utcfromtimestamp(nanoseconds / 1e9)
3030
return ts.strftime("%Y-%m-%dT%H:%M:%S.%fZ")

0 commit comments

Comments
 (0)