Skip to content

Commit dec311f

Browse files
Resolve datetime deprecation warnings (#3433)
* Resolve datetime deprecation warnings Signed-off-by: Emmanuel Ferdman <[email protected]> * Resolve datetime deprecation warnings Signed-off-by: Emmanuel Ferdman <[email protected]> --------- Signed-off-by: Emmanuel Ferdman <[email protected]> Co-authored-by: Riccardo Magliocchetti <[email protected]>
1 parent da661f6 commit dec311f

File tree

1 file changed

+3
-1
lines changed
  • exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole

1 file changed

+3
-1
lines changed

exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868

6969

7070
def _ns_to_time(nanoseconds):
71-
ts = datetime.datetime.utcfromtimestamp(nanoseconds / 1e9)
71+
ts = datetime.datetime.fromtimestamp(
72+
nanoseconds / 1e9, datetime.timezone.utc
73+
)
7274
return ts.strftime("%H:%M:%S.%f")
7375

7476

0 commit comments

Comments
 (0)