Bug 12061 - /bin/date does not interpret TZ as expected
/bin/date does not interpret TZ as expected
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: sh-utils (Show other bugs)
6.0
i386 Linux
low Severity high
: ---
: ---
Assigned To: bero
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-10 14:21 EDT by thoth
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-06 16:27:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description thoth 2000-06-10 14:21:21 EDT
The time zone as reported by date does not necessarily result in correct
behavior when used for the TZ envariable.

[thoth@maya thoth]$ date
Sat Jun 10 14:16:37 EDT 2000
[thoth@maya thoth]$ date +%Z
EDT
[thoth@maya thoth]$ TZ=EDT date
Sat Jun 10 18:16:47 EDT 2000
[thoth@maya thoth]$ TZ=Z date
Sat Jun 10 18:16:58  2000


What is the TZ for EDT anyway?
Comment 1 Jeff Johnson 2001-01-06 14:20:35 EST
This is expected behavior, unknown time zones (like TZ=Z above) use either UTC
or
the native system time w/o timezone modification. Here's what I see on a machine
that keeps time
in UTC, but is in timezone EST:

bash$ date
Sat Jan  6 14:23:03 EST 2001
bash$ TZ=yadda_yadda date
Sat Jan  6 19:23:06 yadda_yadda 2001
bash$ TZ=UTC date
Sat Jan  6 19:23:19 UTC 2001
bash$ TZ=Z date
Sat Jan  6 19:23:28  2001
Comment 2 thoth 2001-01-06 15:28:41 EST
What is the TZ for EDT anyway?
Comment 3 Jeff Johnson 2001-01-06 16:12:08 EST
Eastern Daylight Time, GMT-4, same as New York City.
Comment 4 thoth 2001-01-06 16:24:53 EST
[hammor@comstar3 hammor]$ date
Sat Jan  6 21:28:11 GMT 2001
[hammor@comstar3 hammor]$ TZ=Eastern date
Sat Jan  6 21:28:20 Eastern 2001
[hammor@comstar3 hammor]$ TZ=GMT-4 date
Sun Jan  7 01:28:26 GMT 2001

Please provide sample command line to output the date in Eastern on a machine
with a different /etc/localtime .  Please provide documentation pointers to
derive the proper values for the TZ environment variable for other time zones.

  Consider placing this documentation (or a reference to it) in the manual page
for the date command.
Comment 5 thoth 2001-01-06 16:27:24 EST
Is there any way to get the date command to print out the proper value for the
TZ environment variable?
Comment 6 Jeff Johnson 2001-01-06 16:46:09 EST
TZ is perfectly documented in "info libc", search for TZ.

There is no way that date can print out "proper" settings, as the problem is
equivalent
to defing "proper".

Note You need to log in before you can comment on or make changes to this bug.