home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!rutgers!igor.rutgers.edu!geneva.rutgers.edu!hedrick
- From: hedrick@geneva.rutgers.edu (Charles Hedrick)
- Newsgroups: comp.os.linux
- Subject: Re: Timezone support
- Message-ID: <Jan.6.02.59.45.1993.3195@geneva.rutgers.edu>
- Date: 6 Jan 93 07:59:45 GMT
- References: <C0EGH8.78K@jti.com>
- Organization: Rutgers Univ., New Brunswick, N.J.
- Lines: 46
-
- richb@jti.com (Richard Braun) writes:
-
- >I've created /etc/tzname. I've set my TZ environment variable. I've
- >downloaded the Gnu timezone source code. But I'm still missing
- >something. The shared C library's localtime() function simply isn't
- >picking up the info.
-
- >How do I get the date program and others to use EST5EDT instead of GMT?
-
- The timezone code in libc is based on POSIX-complaint code submitted
- to Berkeley, because at the time I first started testing it, that code
- was in much better shape than Gnu's timezone code. It needs
- /usr/lib/zoneinfo. There are really only one or two necessary files:
- /usr/lib/zoneinfo/localtime and /usr/lib/zoneinfo/posixrules.
- Localtime defines the zone to be used if TZ is not set (the default
- zone). It should be a copy of or symlink to the zone file for your
- time zone. If you don't do anything fancy, that's really all you
- need. On the other hand, if you always set TZ, you don't need
- localtime at all. If like to use TZ (either to define your normal
- zone, or because you like being able to change zones), you need
- posixrules. Posixrules defines the rules to be used to interpret the
- TZ variable. If you need strict POSIX compliance, posixrules should
- be a copy of or link to one of the US zones, e.g.
- /usr/lib/zoneinfo/US/Eastern (it shouldn't matter which one) because
- POSIX specifies that the defaults used in parsing TZ are based on the
- US rules. If I were somewhere outside the U.S., I'd be highly tempted
- to ignore Posix and make posixrules a copy of or link to localtime, so
- that my local rules were used as the defaults.
-
- /usr/lib/zoneinfo is included in Hlu's base distribution, along with
- time.doc, which describes how to set up time, and clock, a utility for
- setting up time from the CMOS clock, and also resetting the CMOS
- clock. (I believe cs.rutgers.edu:/pub/linux/timebin.tar.Z contains
- just the time stuff. /usr/lib/zoneinfo and time.doc from there should
- still be OK if that's all you need. I wouldn't use the executables
- from that distribution, as they are quite old.) Both of these sources
- of zoneinfo include definition files for an immense number of time
- zones. (Did you ever wonder what special rules were used for time
- zones in the Navajo nation? BSD's got them.) You really only need
- files for the zones you're going to use. Indeed once you've got the
- right file copied to localtime and/or posixrules, you can remove all
- the others if you want to.
-
- You can also copy /usr/lib/zoneinfo (or just the files from it that
- you need) from your friendly local Sun or other BSD-based system. I'm
- fairly sure the file formats are compatible.
-