MITHaystack / srt-py

BSD 3-Clause "New" or "Revised" License
10 stars 14 forks source link

utcfromtimestamp deprecated #26

Open AlexKurek opened 5 months ago

AlexKurek commented 5 months ago

https://github.com/MITHaystack/srt-py/blob/master/srt/dashboard/layouts/graphs.py#L266 is deprecated since Python 3.12.

It can be repleced by fromtimestamp:

from datetime import datetime, timezone

ts = 1571595618.0
x = datetime.utcfromtimestamp(ts)
print(x)

y = datetime.fromtimestamp(ts, tz=timezone.utc)
print(y)

2019-10-20 18:20:18 2019-10-20 18:20:18+00:00

AlexKurek commented 3 months ago

Fixed: https://github.com/AlexKurek/srt-py/commit/45a309e7dc55f8f638ec38d5eb9dfa3b6a407b50