Skip to content

fix(opencode): log timestamps use local datetime instead of UTC ISO string #21330

@elonnzhang

Description

@elonnzhang

Description

Two places in packages/opencode/src/util/log.ts use toISOString() which outputs UTC time, not local time:

  1. Log filename (line 66): new Date().toISOString() — filename like 2026-04-07T02:30:00.log reflects UTC, not where the user is
  2. Log entry timestamp (line 127): next.toISOString() — every log line shows UTC time, making it hard to correlate with local events

For users not in UTC, both are confusing. The fix is to format using local time methods instead.

Plugins

No response

OpenCode version

1.3.17

Steps to reproduce

  1. cd ~/.local/share/opencode/log
  2. cat any log file

Screenshot and/or share link

No response

Operating System

macOS 26.4

Terminal

ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

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