From a8fcc61066d792404e6343e065270484ae18c7a3 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Thu, 8 Dec 2022 12:58:26 +0100 Subject: [PATCH] evstore: do not use unixepoch() - for older sqlite --- loctrkd/evstore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loctrkd/evstore.py b/loctrkd/evstore.py index 7c92e3a..8cf3206 100644 --- a/loctrkd/evstore.py +++ b/loctrkd/evstore.py @@ -29,7 +29,7 @@ SCHEMA = ( """create table if not exists pmodmap ( imei text not null unique, pmod text not null, - tstamp real not null default (unixepoch()) + tstamp real not null default (strftime('%s')) )""", ) @@ -144,7 +144,7 @@ def fetchpmod(imei: str) -> Optional[Any]: cur = DB.cursor() cur.execute( """select pmod from pmodmap where imei = ? - and tstamp > unixepoch() - 3600.0""", + and tstamp > strftime('%s') - 3600.0""", (imei,), ) result = cur.fetchone() -- 2.43.0