Skip to content

Commit 136d6b7

Browse files
authored
PCAN: Fix timestamp timezone offset (hardbyte#778)
* PCAN: Fix timestamp timezone offset * PCAN: Add comment on timezone offset
1 parent 74192b3 commit 136d6b7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

can/interfaces/pcan/pcan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
import uptime
1717
import datetime
1818

19+
# boottime() and fromtimestamp() are timezone offset, so the difference is not.
1920
boottimeEpoch = (
20-
uptime.boottime() - datetime.datetime.utcfromtimestamp(0)
21+
uptime.boottime() - datetime.datetime.fromtimestamp(0)
2122
).total_seconds()
2223
except ImportError:
2324
boottimeEpoch = 0

0 commit comments

Comments
 (0)