#7919: feat: implement timezone support for console timestamps and add verification script
stale
size: M
Cluster:
Timezone Support Enhancements
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates console and subsystem “pretty” timestamp formatting to respect the `TZ` environment variable by using `Intl.DateTimeFormat(..., { timeZone })`, and adds regression tests to validate timezone-dependent output. It also adds a small verification script intended for manual validation.
Key code changes are in `src/logging/console.ts` (console capture timestamp prefix) and `src/logging/subsystem.ts` (subsystem logger console line formatting), with new tests covering Asia/Shanghai and America/New_York offsets.
<h3>Confidence Score: 4/5</h3>
- This PR is generally safe to merge; changes are localized to timestamp formatting with test coverage.
- Core behavior changes are small and covered by new tests, but there are a couple of quality issues: the new verification script reports success unconditionally, and the new/updated tests enable fake timers after constructing Date instances, which can cause flakiness in some environments.
- verify-timezone-fix.mjs, src/logging/console-timestamp-tz.test.ts (and related tests)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#14709: fix: display local timezone in console logs
by Daiyimo · 2026-02-12
85.7%
#21859: fix(logs): respect TZ env var for timestamp display, fix Windows ti...
by hydro13 · 2026-02-20
79.2%
#12358: fix: Sessions format timestamps in sessions_history using userTimezone
by xialonglee · 2026-02-09
79.0%
#4901: Show timezone abbreviation in system prompt
by dpalfox · 2026-01-30
78.6%
#5624: add support_human_readable_time_format in cron
by simran122 · 2026-01-31
77.9%
#19611: fix: use local timezone in log file and console timestamps
by tag-assistant · 2026-02-18
77.8%
#3973: fix: enhance npm package integrity checks and include critical files
by YeSuX · 2026-01-29
76.5%
#6110: refactor: simplify boolean logic using nullish coalescing
by T1mn · 2026-02-01
75.8%
#19923: feat: track held messages during compaction gate and split verifica...
by PrivacySmurf · 2026-02-18
75.4%
#6059: fix #6044
by vivganes · 2026-02-01
75.1%