Skip to content

Timezone issue: Thread timestamps displayed in UTC instead of system timezone (Asia/Shanghai) #281

@cicav

Description

@cicav

Describe the bug

When Knowledge Mem processes threads from Hermes Agent session database, the timestamps are displayed in UTC instead of the system timezone (Asia/Shanghai / CST, UTC+8).

To Reproduce

  1. Have Hermes Agent sessions stored in ~/.hermes/state.db (Unix timestamps)
  2. Enable autoThreadAnalysis: true in Knowledge Mem settings
  3. Let Knowledge Mem process the threads
  4. Check the generated memory files in OV storage

Expected behavior

Memory files should show timestamps in the system timezone (e.g., "Time: 2026-06-05 09:58" for a session that started at 09:58 CST).

Actual behavior

Memory files show UTC timestamps (e.g., "Time: 2026-06-05 01:58" for the same session, which is 8 hours behind CST).

Root cause analysis

The Hermes session database stores started_at as Unix timestamps (correct, timezone-agnostic). When Knowledge Mem reads these timestamps and formats them for display in the Time: line of memory files, it uses UTC instead of the system timezone.

Environment

  • macOS with timezone set to Asia/Shanghai (UTC+8)
  • Knowledge Mem desktop app version: 0.3.23
  • Hermes Agent sessions stored in SQLite at ~/.hermes/state.db

Impact

All auto-backfilled memory entries have incorrect timestamps, making it difficult to correlate events with actual session times.

Workaround

A post-processing script that reads the correct CST times from the Hermes session DB and updates the Time: lines in memory files via the OV API.

Suggested fix

When formatting Unix timestamps for display, use the system timezone (via Intl.DateTimeFormat().resolvedOptions().timeZone in Electron, or equivalent) instead of defaulting to UTC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions