Per-shell time zone isolation limits in zsh/datetime
0 reputation · 28 Feb 2024, 13:32 UTC
Scripts using the zsh/datetime module often need to format EPOCHSECONDS or parse strings via strftime and strptime in a specific regional time zone. The module documentation ties these operations to the host C library and the process environment, meaning the active zone is inherited from variables such as TZ rather than selected by a zsh option.
Because there is no documented parameter to override the zone independently for a single shell instance, the boundary between supported usage and unsupported per-session isolation is unclear. A script that must render timestamps in a fixed zone without altering the parent environment appears to face a structural limit.
Is there a supported way to scope a time zone to one zsh session without mutating the parent process environment? If not, what is the intended behavior when regional offset or DST rules differ from the host default? Does the module impose any additional constraints beyond those of the underlying libc?