Resolve datetime deprecation warnings (#3433)
* Resolve datetime deprecation warnings Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> * Resolve datetime deprecation warnings Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> --------- Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
This commit is contained in:
parent
da661f6547
commit
dec311ff0e
|
|
@ -68,7 +68,9 @@ from opentelemetry.semconv.trace import SpanAttributes
|
||||||
|
|
||||||
|
|
||||||
def _ns_to_time(nanoseconds):
|
def _ns_to_time(nanoseconds):
|
||||||
ts = datetime.datetime.utcfromtimestamp(nanoseconds / 1e9)
|
ts = datetime.datetime.fromtimestamp(
|
||||||
|
nanoseconds / 1e9, datetime.timezone.utc
|
||||||
|
)
|
||||||
return ts.strftime("%H:%M:%S.%f")
|
return ts.strftime("%H:%M:%S.%f")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue