bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14229: invalid TZ and /bin/date


From: Pádraig Brady
Subject: bug#14229: invalid TZ and /bin/date
Date: Thu, 18 Apr 2013 15:45:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 04/18/2013 01:24 PM, Donald Berry wrote:
> If an invalid TZ argument is passed to /bin/date, it silently fails but 
> prints the UTC result:
> address@hidden ~]$ TZ=EDT date -d @0
> Thu Jan  1 00:00:00 EDT 1970
> address@hidden ~]$ TZ=foo date -d @0
> Thu Jan  1 00:00:00 foo 1970
> 
> It works correctly if using no argument or a valid argument:
> address@hidden ~]$ date -d @0
> Wed Dec 31 19:00:00 EST 1969
> address@hidden ~]$ TZ=EST5EDT date -d @0
> Wed Dec 31 19:00:00 EST 1969
> address@hidden ~]$ TZ=UTC date -d @0
> Thu Jan  1 00:00:00 UTC 1970
> 
> address@hidden ~]$ rpm -q coreutils
> coreutils-8.4-19.el6.x86_64
> address@hidden ~]$ uname -a
> Linux dberry.csb 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 
> 2012 x86_64 x86_64 x86_64 GNU/Linux
> address@hidden ~]$ cat /etc/redhat-release 
> Red Hat Enterprise Linux Workstation release 6.3 (Santiago)
> address@hidden ~]$ date
> Thu Apr 18 16:23:46 EDT 2013

This is really annoying and confusing.
However as I understand it, there is no interface currently
that coreutils can use, to determine that a match wasn't found.
All I can recommend is to use location based zone instead
which have less scope for mismatches:
http://www.pixelbeat.org/docs/linux_timezones/

thanks,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]