Skip to content

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

Closed as not planned

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 7, 2026
  2. github-actions commented on Apr 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. added a commit that references this issue on Apr 7, 2026
    f1403ef
  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. v4ever1luv commented on Jun 2, 2026

    @v4ever1luv

    PR #30350 has been submitted which addresses this issue by replacing toISOString() with local-time formatting in log.ts.

  6. ricjuhnl commented on Jul 9, 2026

    @ricjuhnl

    PR #30350 has been submitted which addresses this issue by replacing toISOString() with local-time formatting in log.ts.

    Unfortuanlly all PR related to this are closed, issue is still valid

  7. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions