zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: linuxtechguy@gmail.com
Cc: zsh <zsh-users@zsh.org>
Subject: Re: Possible inconsistency with use of TZ to change zone output '%Z"
Date: Wed, 12 Jan 2022 11:09:56 -0800	[thread overview]
Message-ID: <CAH+w=7bCXvWnU4PguF9HigBDJZznwj+RVGMhgc2kQVgKxv3MRQ@mail.gmail.com> (raw)
In-Reply-To: <CA+rB6GL_yZBQbxesOqL8skz6bx=psXyu=nT62TE61La--jAWsQ@mail.gmail.com>

On Sat, Jan 8, 2022 at 7:33 AM Jim <linux.tech.guy@gmail.com> 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.


      reply	other threads:[~2022-01-12 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  0:39 Jim
2022-01-07  0:58 ` Bart Schaefer
2022-01-08 15:32   ` Jim
2022-01-12 19:09     ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bCXvWnU4PguF9HigBDJZznwj+RVGMhgc2kQVgKxv3MRQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=linuxtechguy@gmail.com \
    --cc=zsh-users@zsh.org \
    --subject='Re: Possible inconsistency with use of TZ to change zone output '\''%Z"' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).