]> www.average.org Git - loctrkd.git/commitdiff
evstore: do not use unixepoch() - for older sqlite
authorEugene Crosser <crosser@average.org>
Thu, 8 Dec 2022 11:58:26 +0000 (12:58 +0100)
committerEugene Crosser <crosser@average.org>
Thu, 8 Dec 2022 11:58:26 +0000 (12:58 +0100)
loctrkd/evstore.py

index 7c92e3a1d5291105042484518c442cb67a06d39c..8cf320621d74845608650c91aed5e8579af15fdc 100644 (file)
@@ -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()