From 07d496edaf4841ae7f2c30301272e3c29be65e71 Mon Sep 17 00:00:00 2001 From: Morgan Date: Wed, 1 Apr 2026 14:55:17 +0900 Subject: [PATCH] Fix timezone on screentimed --- screentimed/screentimed | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/screentimed/screentimed b/screentimed/screentimed index 23fc4f2..77fca06 100755 --- a/screentimed/screentimed +++ b/screentimed/screentimed @@ -104,12 +104,13 @@ def _day_range(date): def _query_db(db, table, date): + day_start, day_end = _day_range(date) return db.execute(f''' SELECT app_id, start_ts, end_ts FROM {table} - WHERE end_ts > unixepoch(:date) - AND start_ts < unixepoch(:date, '+1 day') - ''', {'date': date}).fetchall() + WHERE end_ts > :start + AND start_ts < :end + ''', {'start': day_start, 'end': day_end}).fetchall() def _aggregate_daily(sessions, day_start, day_end):