#4901: Show timezone abbreviation in system prompt
agents
Cluster:
Timezone Support Enhancements
Adds \getTimezoneAbbreviation()\ to convert IANA timezone names (e.g. \America/New_York\) to friendly abbreviations (e.g. \EST\).
The system prompt now shows:
\\\
Time zone: America/New_York (EST)
\\\
instead of just:
\\\
Time zone: America/New_York
\\\
This makes it easier for the AI to understand and communicate about timezones.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds `getTimezoneAbbreviation()` in `src/agents/date-time.ts` and updates `buildTimeSection()` in `src/agents/system-prompt.ts` to display the user’s IANA timezone along with a short `Intl.DateTimeFormat`-derived timezone label (e.g., `America/New_York (EST)`) when they differ.
The change integrates into the system prompt construction path by enriching the existing “Current Date & Time” section, without altering other prompt sections or the timezone resolution logic.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge, with minor correctness/UX concerns around what `Intl` returns for “short” timezone names.
- Changes are small and localized, and use a standard `Intl.DateTimeFormat` API with a try/catch fallback. The main risk is that `timeZoneName: "short"` does not reliably produce abbreviations like `EST/PST` across environments/locales and can yield GMT offsets (e.g., `GMT-5`) or localized strings, which may reduce the intended benefit but shouldn’t break functionality.
- src/agents/date-time.ts (abbreviation semantics), src/agents/system-prompt.ts (display logic expectations)
<!-- 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
#7919: feat: implement timezone support for console timestamps and add ver...
by southpy · 2026-02-03
78.6%
#14709: fix: display local timezone in console logs
by Daiyimo · 2026-02-12
75.8%
#21859: fix(logs): respect TZ env var for timestamp display, fix Windows ti...
by hydro13 · 2026-02-20
72.5%
#10836: feat(session_status): include ISO-8601 and Unix timestamps for sche...
by jeanlucthumm · 2026-02-07
72.2%
#12358: fix: Sessions format timestamps in sessions_history using userTimezone
by xialonglee · 2026-02-09
71.7%
#5624: add support_human_readable_time_format in cron
by simran122 · 2026-01-31
71.6%
#13510: Enable Dynamic Date Injection in System Resolve #12616
by Harrrdik18 · 2026-02-10
69.3%
#7488: Handle future timestamps in relative time
by lawyered0 · 2026-02-02
68.1%
#19716: fix: inject timestamp into channel message agent context (#16442)
by chi777 · 2026-02-18
67.8%
#9490: Add Internationalization (i18n) Support
by luuman · 2026-02-05
67.7%