-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
| cpu_time = datetime.utcnow() |
SSDAQ/ssdaq/receivers/readout_assembler.py
Line 255 in 7c70571
| cpu_time_s = int(r_cpu_time.timestamp()) |
Using datetime.datetime.utcnow().timestamp() results in an incorrect unix time if your timezone is not UTC.
See https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow and https://bugs.python.org/issue33293.
Correct approach to get seconds from epoch (UTC/unix) using the datetime package is datetime.datetime.now(datetime.timezone.utc).timestamp().
Existing SS data therefore contain a timestamp that if you assume is unix time, is two hours earlier than the true unix time.
Metadata
Metadata
Assignees
Labels
No labels