Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible inconsistency with use of TZ to change zone output '%Z"
- X-seq: zsh-users 27464
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: linuxtechguy@xxxxxxxxx
- Cc: zsh <zsh-users@xxxxxxx>
- Subject: Re: Possible inconsistency with use of TZ to change zone output '%Z"
- Date: Wed, 12 Jan 2022 11:09:56 -0800
- Archived-at: <https://zsh.org/users/27464>
- In-reply-to: <CA+rB6GL_yZBQbxesOqL8skz6bx=psXyu=nT62TE61La--jAWsQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CA+rB6GKHQWng-N=S8ypjernxDYoKtsKZqMMBoXjTaYrywgPzoA@mail.gmail.com> <CAH+w=7ZA2Wzw1Kjr1ny1gk+D7-CDWL_36h=pKAAx2P8A5kJRBg@mail.gmail.com> <CA+rB6GL_yZBQbxesOqL8skz6bx=psXyu=nT62TE61La--jAWsQ@mail.gmail.com>
On Sat, Jan 8, 2022 at 7:33 AM Jim <linux.tech.guy@xxxxxxxxx> wrote:
>
> Unfortunately my searches never found that mail thread. Sorry about that.
> I'm sure the print builtin has nothing to do with the results I am getting.
I didn't mean to imply that you should have found that thread on your
own, sorry. The significant bit is that there is some discussion of
possible patches in that thread.
> But if parameter expansion is using zsh's strftime shouldn't it act the
> same way as calling strftime directly.
The %-replacements for zsh's strftime do not map 1-to-1 onto every
underlying strftime implementation, so it's not a direct pass-through.
However --
> 1) DT=${(%):-%D{$Fmt}}
> 2) zstat -F $Fmt -A A +mtime $F
> 3) strftime -s DT $Fmt $ET
-- the patch discussion from the other thread comes down to: In the
third case, the strftime builtin has an execution context in which it
is able to implicitly create a temporary export of TZ and then delete
it again before returning, so it does that (this was a change
implemented some time after the datetime module was first created).
In the first case there is no such context so a solution is messy, and
in the second (zstat) case the equivalent export has simply never been
implemented even though it would be possible to do so.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author