mirror of
https://github.com/morgan9e/linux-sys-telemetry
synced 2026-04-14 00:04:07 +09:00
Fix timezone on screentimed
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user