From: Clinton Bunch <cdbunch@zentaur.org>
To: zsh-users@zsh.org
Subject: Timezones and print -P %D
Date: Thu, 12 Nov 2020 13:38:59 -0600 [thread overview]
Message-ID: <0e1487c3-589f-3b91-87e8-48fb964e633a@zentaur.org> (raw)
Can someone explain what's going on here? I was under the impression
that variable assignments on the command-line were exported to the
environment and only effective for the life of the command.
cdblinux[~]% unset TZ
cdblinux[~]% print -P '%D{%Y-%m-%dT%H:%M%z}'
2020-11-12T13:32-0600
cdblinux[~]% TZ=UTC print -P '%D{%Y-%m-%dT%H:%M%z}'
2020-11-12T13:33-0600
cdblinux[~]% export TZ
cdblinux[~]% TZ=UTC print -P '%D{%Y-%m-%dT%H:%M%z}'
2020-11-12T19:33+0000
cdblinux[~]% print -P '%D{%Y-%m-%dT%H:%M%z}'
2020-11-12T19:33+0000
cdblinux[~]% unset TZ
cdblinux[~]% print -P '%D{%Y-%m-%dT%H:%M%z}'
2020-11-12T13:33-0600
cdblinux[~]% cat /etc/system-release
CentOS Linux release 8.2.2004 (Core)
cdblinux[~]% uname -a
Linux cdblinux.cfhp.com 4.18.0-193.14.2.el8_2.x86_64 #1 SMP Sun Jul 26
03:54:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
cdblinux[~]% echo $ZSH_VERSION
5.5.1
next reply other threads:[~2020-11-12 19:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 19:38 Clinton Bunch [this message]
2020-11-13 4:06 ` Phil Pennock
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=0e1487c3-589f-3b91-87e8-48fb964e633a@zentaur.org \
--to=cdbunch@zentaur.org \
--cc=zsh-users@zsh.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public 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).