From: hedrick@geneva.rutgers.edu (Charles Hedrick) Subject: Re: Date command only uses GMT Date: 5 Apr 1993 01:21:33 GMT
jbettis@cse.unl.edu (Jeremy Bettis) writes:
>I have been unable to get the date command to display the correct timezone.
>I edited the /etc/login.defs file and set the ENV_TZ variable. Now TZ is set
>to CST6CDT like it ought to be but date still prints out GMT.
I suspect you need to set up /usr/lib/zoneinfo. You need at least one
of posixrules or localtime. posixrules should be a link to or copy of
one of the US zones, e.g. US/Eastern. (It doesn't matter which one,
and it should be a US zone even if you're not in the U.S.) posixrules
is needed to interpret the TZ environment variable. Without it, TZ is
ignored. localtime sets up a default local zone, for cases where TZ
isn't defined. It should be a link to or copy of the correct zone for
your site. See tsx-11:pub/linux/binaries/usr.bin/timebin.tar.Z for a
full /usr/lib/zoneinfo and instructions for setting it up. In my
opinion, all distributions of the libraries should include
/usr/lib/zoneinfo/posixrules, since without that the time routines are
not POSIX-compatible.
If you're getting the right time now, then putting it in the right
zone will probably give you the wrong time. Once you have the zone
set, you need to set the kernel's time to GMT rather than local.
Probably the simplest thing is to use the program "clock", which comes
in timebin. Assuming your DOS clock is set to local time, you want to
put "clock -s" in your rc file. (Actually there seems to be a more
recent version of clock, probably in one of Rik Faith's GNU utilities
packages. I think the one in timebin will still work, but I'd try to
find the current one.) If your DOS clock is in GMT, use "clock -u -s".