Skip to content

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

Closed

Description

@elonnzhang

Description

Locale.timestamp() in `packages/opencode/src/util/locale.ts` is used to format log entry timestamps, but the name is misleading — "timestamp" typically implies a numeric Unix timestamp or a UTC ISO string, not a local datetime string.

The function actually returns local time in `YYYY-MM-DDTHH:mm:ss` format using `getFullYear()`, `getHours()`, etc. (local time methods, not UTC). The naming makes it easy to assume the output is UTC, which causes confusion when reading logs.

Proposed fix: rename `Locale.timestamp()` → `Locale.localDatetime()` to make the intent clear and align with the existing `Locale.datetime()` naming convention in the same namespace.

Call sites to update:

  • `packages/opencode/src/util/log.ts` — log message formatting and log filename generation

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 doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Every issue must use one of: Bug Report, Feature Request, or Question
    • The title uses a commit message convention (fix(opencode):) rather than an issue title — if this is a feature/change request, it should start with [FEATURE]: and include the required verification checkbox and description
    • Bug reports require reproduction steps and context; feature requests require a clear explanation of the problem or need — the current description reads more like a PR description than an issue

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. changed the title [-]fix(opencode): log timestamps use ISO format instead of local datetime[/-] [+]fix(opencode): log timestamps use local datetime instead of UTC ISO string[/+] on Apr 7, 2026
  4. github-actions commented on Apr 7, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! Unfortunately, it still doesn't fully meet our contributing guidelines.

    What still needs to be fixed:

    • No issue template used. Every issue must use one of: Bug Report, Feature Request, or Question. Please edit your issue to follow the structure of the appropriate template.
    • Title format. The title still uses a commit message convention (fix(opencode):). If this is a feature/change request, the title must start with [FEATURE]:. If it's a bug report, please use a plain descriptive title.
    • Template requirements:
      • If Bug Report: include a proper Description field and reproduction steps/context.
      • If Feature Request: title must start with [FEATURE]:, include the verification checkbox, and explain the problem or need.

    Please edit the issue to use one of the required templates and update the title accordingly.

  5. elonnzhang commented on Apr 7, 2026

    @elonnzhang
    Author

    Closing — will resubmit with correct format.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions