MCPcopy Create free account
hub / github.com/python-arq/arq / ms_to_datetime

Function ms_to_datetime

arq/utils.py:54–62  ·  view source on GitHub ↗

convert milliseconds to datetime, use the timezone in os.environ

(unix_ms: int)

Source from the content-addressed store, hash-verified

52
53
54def ms_to_datetime(unix_ms: int) -> datetime:
55 """
56 convert milliseconds to datetime, use the timezone in os.environ
57 """
58 dt = datetime.fromtimestamp(unix_ms / 1000, tz=timezone.utc)
59 tz = get_tz()
60 if tz:
61 dt = dt.astimezone(tz)
62 return dt
63
64
65@overload

Callers 3

deserialize_jobFunction · 0.85
deserialize_resultFunction · 0.85
run_jobMethod · 0.85

Calls 1

get_tzFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…