hermes - 💡(How to fix) Fix Dashboard analytics daily chart uses UTC instead of configured timezone [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

SELECT date(started_at, 'unixepoch') as day, ...
FROM sessions WHERE started_at > ?
GROUP BY day ORDER BY day

---

SELECT date(started_at + ?, 'unixepoch') as day, ...
RAW_BUFFERClick to expand / collapse

Problem

The daily token usage chart on the Dashboard analytics page groups sessions by UTC date, ignoring the user-configured timezone. For users outside UTC, this causes:

  • Today's sessions that started after midnight local time but before midnight UTC are grouped under yesterday in the chart
  • Sessions across date boundaries (e.g., local midnight) get split across wrong days

Current Behavior

SELECT date(started_at, 'unixepoch') as day, ...
FROM sessions WHERE started_at > ?
GROUP BY day ORDER BY day

date(started_at, 'unixepoch') gives UTC dates regardless of the timezone setting in config.yaml.

Expected Behavior

The chart should respect the user's configured timezone (or server-local timezone). For example, if timezone: Asia/Bangkok (UTC+7), daily grouping should use Bangkok dates.

Proposed Fix

Add the timezone offset (seconds) to started_at before converting:

SELECT date(started_at + ?, 'unixepoch') as day, ...

Where ? is the offset from hermes_time.get_timezone().

Compatibility Note

This change only touches the backend SQL query — the response schema (daily array with day, input_tokens, output_tokens, etc.) stays identical. The frontend uses day as a date string ("2026-05-12") via toLocaleDateString(), so it is backward-compatible with cached frontend JS. No new fields needed.

Related

Hermes already supports timezone configuration via:

  • timezone key in ~/.hermes/config.yaml
  • HERMES_TIMEZONE env var (legacy)
  • hermes_time.now() / hermes_time.get_timezone() helper

This was partially addressed in v0.4.0 (naive timestamp fix) but the dashboard analytics chart was never updated.

Environment

  • Hermes Agent current main
  • Affected page: Dashboard → Analytics → Daily Token Usage

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Dashboard analytics daily chart uses UTC instead of configured timezone [2 pull requests]