Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[bug] TZ=FOO5 stat -F%Z +mtime does not work unless TZ is otherwise exported



$ zsh -c 'zmodload zsh/stat; TZ=FOO5 stat -F%Z +mtime /'
GMT

$ export TZ=Europe/London
$ zsh -c 'zmodload zsh/stat; TZ=FOO5 stat -F%Z +mtime /'
FOO

(I suppose that's because it needs to be retrievable by getenv()
so that strftime() can access it, and VAR=value builtin doesn't
bother updating environ?).

The strftime builtin (from zsh/datetime) doesn't seem to have
the problem.

Doing:

f() stat -F%Z +mtime /
TZ=FOO5 f

is also fine.

LC_TIME=fr_FR.UTF-8 stat -F%A +mtime /

is also fine.

-- 
Stephane




Messages sorted by: Reverse Date, Date, Thread, Author