From 182a8af57f9864f3a43211d7e490a9d9970b03c9 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 7 Jul 2019 14:09:24 +0200 Subject: [PATCH] deliver better timestamps --- htdocs/openwebrx.js | 2 +- owrx/wsjt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 5103c85..2caf7e1 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1248,7 +1248,7 @@ function on_ws_recv(evt) case "wsjt_message": var msg = json.value; var $b = $('#openwebrx-panel-wsjt-message tbody'); - var t = new Date(msg['timestamp'] * 1000); + var t = new Date(msg['timestamp']); var pad = function(i) { return ('' + i).padStart(2, "0"); } $b.append($( '' + diff --git a/owrx/wsjt.py b/owrx/wsjt.py index b16b5e6..8c5a7af 100644 --- a/owrx/wsjt.py +++ b/owrx/wsjt.py @@ -121,7 +121,7 @@ class WsjtParser(object): out = {} ts = datetime.strptime(msg[0:6], "%H%M%S") - out["timestamp"] = datetime.combine(date.today(), ts.time(), datetime.now().tzinfo).timestamp() + out["timestamp"] = int(datetime.combine(date.today(), ts.time(), datetime.now().tzinfo).timestamp() * 1000) out["db"] = float(msg[7:10]) out["dt"] = float(msg[11:15]) out["freq"] = int(msg[16:20])