← Back to PRs

#14709: fix: display local timezone in console logs

by Daiyimo open 2026-02-12 14:37 View on GitHub →
stale size: XS
### Description Fixes #14699 This PR addresses the issue where console logs were hardcoded to UTC time using `toISOString()`. It updates the formatting to respect the user's local system timezone. ### Changes - Updated `formatConsoleTimestamp` in `src/logging/console.ts`. - Uses `toLocaleTimeString` with `en-GB` locale to ensure a consistent 24-hour format (HH:mm:ss) across different environments. - Adjusted standard style to reflect the local timezone offset. ### Test Configuration - System Timezone: Asia/Shanghai (UTC+8) - Result: Logs now correctly match the system clock instead of being 8 hours behind. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This change updates `formatConsoleTimestamp()` in `src/logging/console.ts` so console-captured output uses local time instead of `toISOString()`’s UTC. Main concern is the new “compact/json” timestamp prefix format: it’s now an ISO-like string without any timezone designator, which is ambiguous and breaks an existing test expectation. Also, other console logging paths (notably `src/logging/subsystem.ts`’s `formatConsoleLine()` and JSON console output) still use `toISOString()`, so many console timestamps will remain UTC despite the PR’s stated intent. <h3>Confidence Score: 3/5</h3> - This PR is moderately safe to merge after fixing timestamp format consistency and covering remaining UTC console paths. - The change is localized, but it introduces an ambiguous ISO-like timestamp (no timezone designator) and appears to leave other console timestamp codepaths still emitting UTC, conflicting with the PR’s stated goal and breaking existing test expectations. - src/logging/console.ts; src/logging/subsystem.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs