From: Eugene Crosser Date: Thu, 8 Dec 2022 11:58:26 +0000 (+0100) Subject: evstore: do not use unixepoch() - for older sqlite X-Git-Tag: 1.98~1 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=a8fcc61066d792404e6343e065270484ae18c7a3 evstore: do not use unixepoch() - for older sqlite --- 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()