home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 22892 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.0 KB

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