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:
Emmanuel Ferdman
2025-04-30 17:02:51 +03:00
committed by GitHub
parent da661f6547
commit dec311ff0e

View File

@ -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")