Fix timezone on screentimed

This commit is contained in:
2026-04-01 14:55:17 +09:00
parent 6b727c4fd0
commit 07d496edaf

View File

@@ -104,12 +104,13 @@ def _day_range(date):
def _query_db(db, table, date): def _query_db(db, table, date):
day_start, day_end = _day_range(date)
return db.execute(f''' return db.execute(f'''
SELECT app_id, start_ts, end_ts SELECT app_id, start_ts, end_ts
FROM {table} FROM {table}
WHERE end_ts > unixepoch(:date) WHERE end_ts > :start
AND start_ts < unixepoch(:date, '+1 day') AND start_ts < :end
''', {'date': date}).fetchall() ''', {'start': day_start, 'end': day_end}).fetchall()
def _aggregate_daily(sessions, day_start, day_end): def _aggregate_daily(sessions, day_start, day_end):