← Back to PRs

#4901: Show timezone abbreviation in system prompt

by dpalfox open 2026-01-30 20:46 View on GitHub →
agents
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