zsh-users
 help / color / mirror / code / Atom feed
* Timezones and print -P %D
@ 2020-11-12 19:38 Clinton Bunch
  2020-11-13  4:06 ` Phil Pennock
  0 siblings, 1 reply; 2+ messages in thread
From: Clinton Bunch @ 2020-11-12 19:38 UTC (permalink / raw)
  To: zsh-users

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-13  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 19:38 Timezones and print -P %D Clinton Bunch
2020-11-13  4:06 ` Phil Pennock

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).