[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash 4.2 printf %()T seems to ignore TZ
From: |
Dennis Williamson |
Subject: |
Re: Bash 4.2 printf %()T seems to ignore TZ |
Date: |
Wed, 16 Feb 2011 09:09:14 -0600 |
On Wed, Feb 16, 2011 at 7:22 AM, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> On Tue, Feb 15, 2011 at 09:49:16PM -0600, Dennis Williamson wrote:
>> SECS=1275250155
>> export TZ=EST5EDT
>> printf "%()T\n" $SECS
>> printf "%(%e-%b-%Y %T %Z)T\n" $SECS # added %Z
>>
>> result:
>>
>> 15:09:15
>> 30-May-2010 15:09:15 CDT
>
> I can't duplicate your problem on HP-UX 10.20:
>
> imadev:~$ s=1275250155; TZ=CST6CDT printf '%(%T %Z)T\n' "$s"
> 15:09:15 CDT
> imadev:~$ s=1275250155; printf '%(%T %Z)T\n' "$s"
> 16:09:15 EDT
>
> That appears to be the correct result. Maybe your issue involves
> something in libc?
>
I can also reproduce this on Cygwin.
$ s=1275250155; TZ=CST6CDT printf '%(%T %Z)T\n' "$s"
15:09:15 CDT
$ s=1275250155; TZ=EST5EDT printf '%(%T %Z)T\n' "$s"
15:09:15 CDT
$ s=1275250155; printf '%(%T %Z)T\n' "$s"
15:09:15 CDT
$ date -d @$s "+%T %Z"
15:09:15 CDT
$ TZ=EST5EDT date -d @$s "+%T %Z"
16:09:15 EDT
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS -I. -I.
-I./include -I./lib -g -O2
uname output: CYGWIN_NT-6.0 hostname 1.7.7(0.230/5/3) 2010-08-31 09:58
i686 Cygwin
Machine Type: i686-pc-cygwin
Bash Version: 4.2
Patch Level: 0
Release Status: release