Red Hat Bugzilla – Bug 491448
Date quietly gives bogus results on unknown TZ values.
Last modified: 2009-04-18 04:36:11 EDT
If you set the TZ environment variable to an unknown value, the date command takes this to mean GMT, but gives the user no indication that this has occurred.
An error message would be useful.
$ TZ=NZ date ; TZ=NZDT /bin/date
Sat Mar 21 15:19:31 NZDT 2009
Sat Mar 21 02:19:31 NZDT 2009
Thanks for report. Already reported (found two cases) to upstream - one - the closest is http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00105.html . Upstream maintainer stated the only place where such thing could be fixed is glibc. Not sure if already reported, will check on Monday and possibly reassign.
Ok, nothing new discovered, I think there is no way how to handle this in date directly (at least no easy way), so reassigning to glibc...
There is no way to signal error in these situations. Just be careful when you do this. For a reason there are scripts like tzselect which will produce the correct TZ setting.