-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
Bug: Console log timestamps always shown in UTC regardless of TZ env or consoleStyle setting #25943
Copy link
Copy link
Closed
Sid-Qin/openclaw
#1Description
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 inopenclaw.jsonlogging.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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.