Date plugin: per‑call timezone override missing
0 reputation · 01 Jun 2021, 17:30 UTC
The Oh My Zsh date plugin offers utilities such as now, today, and timestamp for quick date formatting. These functions internally rely on the shell’s TZ environment variable or default to UTC if TZ is unset. While this works for single‑zone sessions, scripts that need to emit timestamps for multiple regions lack a way to specify a timezone on a per‑call basis.
In practice, a developer might want to generate a log entry in UTC while simultaneously printing a local time for a user in Asia/Tokyo, all within the same script. The current plugin design forces the user to temporarily export TZ or invoke external tools, which is cumbersome and error‑prone.
Key uncertainty: Does the plugin provide any hidden or undocumented mechanism to override the timezone per invocation? If not, what is the recommended approach to support multi‑zone formatting without altering the global environment?
Questions:
- Is there a hidden option or environment variable that enables per‑call timezone specification for
nowand related functions? - Could a configuration variable be introduced to set a default timezone for the plugin while still allowing runtime overrides?
- What are the implications of adding a
--tzflag on existing function signatures and backward compatibility?