Skip to content

Bug: Console log timestamps always shown in UTC regardless of TZ env or consoleStyle setting #25943

@yozu

Description

@yozu

Summary

Console log timestamps (e.g. 01:01:39 [canvas], 01:00:31 [ws]) are always displayed in UTC, even when:

  • System timezone is set to Asia/Tokyo (JST, UTC+9)
  • env.TZ: "Asia/Tokyo" is configured in openclaw.json
  • logging.consoleStyle: "pretty" is set

Root cause (from source)

In subsystem-DkqfG4LL.js, formatConsoleLine() uses:

if (opts.style === "pretty") return color.gray((new Date()).toISOString().slice(11, 19));

toISOString() always returns UTC. Slicing [11,19] extracts HH:MM:SS in UTC, ignoring the local timezone entirely. This applies to all pretty and compact styles.

Expected behavior

Log timestamps should reflect the local timezone (as configured via TZ env or system timezone).

Suggested fix

Replace toISOString().slice(11, 19) with local-time methods:

if (opts.style === "pretty") {
  const h = String(now.getHours()).padStart(2, "0");
  const m = String(now.getMinutes()).padStart(2, "0");
  const s = String(now.getSeconds()).padStart(2, "0");
  return color.gray(`${h}:${m}:${s}`);
}

Environment

  • OpenClaw version: 2026.2.23 (b817600)
  • OS: Linux (WSL2)
  • System TZ: Asia/Tokyo
  • Node.js: v24.13.0

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