Compare commits
4 Commits
57c04685a1
...
main
Author | SHA1 | Date | |
---|---|---|---|
a327aed72e | |||
c0dfb9b628 | |||
373fac3184
|
|||
1d93319c92
|
@ -1,4 +1,5 @@
|
||||
import ntp.packet
|
||||
import ntp.ntpc
|
||||
import threading
|
||||
from contextlib import AbstractContextManager
|
||||
import time
|
||||
@ -40,14 +41,7 @@ def pass_value(x):
|
||||
return x
|
||||
|
||||
def string_ntp_seconds(x):
|
||||
h1, h2 = x.split('.')
|
||||
seconds = int(h1, 16)
|
||||
fraction = int(h2, 16)
|
||||
ntp_epoch = datetime.datetime(1900, 1, 1)
|
||||
timestamp = ntp_epoch + datetime.timedelta(seconds=seconds)
|
||||
microseconds = fraction // 1000
|
||||
timestamp = timestamp.replace(microsecond=microseconds)
|
||||
return f"{timestamp} UTC"
|
||||
return ntp.ntpc.prettydate(x).split(' ')[1]
|
||||
|
||||
|
||||
SYSINFO_KEYS = [
|
||||
|
Reference in New Issue
Block a user