From 8c26931e0b26bede0dfc69e8ad5acf6effb7d789 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Fri, 27 Sep 2019 13:41:00 -0700 Subject: [PATCH] fix time conversion bug --- opentelemetry-sdk/src/opentelemetry/sdk/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/util.py b/opentelemetry-sdk/src/opentelemetry/sdk/util.py index d855e851794..4f4ec82b9d9 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/util.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/util.py @@ -26,5 +26,5 @@ def time_ns(): def ns_to_iso_str(nanoseconds): """Get an ISO 8601 string from time_ns value.""" - ts = datetime.datetime.fromtimestamp(nanoseconds / 1e9) + ts = datetime.datetime.utcfromtimestamp(nanoseconds / 1e9) return ts.strftime("%Y-%m-%dT%H:%M:%S.%fZ")