Skip to content

Instantly share code, notes, and snippets.

@edinella
Last active February 17, 2025 14:35
Show Gist options
  • Save edinella/8f4e072c3a8df19b1e46b382eb5da8a8 to your computer and use it in GitHub Desktop.
Save edinella/8f4e072c3a8df19b1e46b382eb5da8a8 to your computer and use it in GitHub Desktop.

O banco de dados do histórico fica em ~/Library/Application Support/Arc/User Data/Default/History

Abrir com https://sqlitebrowser.org

Query para sumarizar períodos:

SELECT 
    datetime(min(v.visit_time)/1000000 - 11644473600, 'unixepoch', '-3 hours') AS start_time,
    datetime(max(v.visit_time)/1000000 - 11644473600, 'unixepoch', '-3 hours') AS end_time
FROM visits v
WHERE visit_time BETWEEN 
    (strftime('%s', '2025-01-01 07:00:00', 'utc') + 11644473600) * 1000000 
    AND 
    (strftime('%s', '2025-02-28 06:59:59', 'utc') + 11644473600) * 1000000
GROUP BY date(datetime(v.visit_time/1000000 - 11644473600, 'unixepoch', '-3 hours'), '-5 hours')
ORDER BY start_time;

Obs:

  • Considerando fuso horário GMT -3
  • Considerando virada de dia as 5 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment