fix date formatting
This commit is contained in:
parent
57c04685a1
commit
c0dfb9b628
@ -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 = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user