home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.admin
- Subject: Re: MDT error converting to Zulu
- Message-ID: <14377@auspex-gw.auspex.com>
- Date: 31 Aug 92 17:27:16 GMT
- References: <1992Aug31.161623.6205@fcom.cc.utah.edu>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 42
- Nntp-Posting-Host: bootme.auspex.com
-
- > To identify the current file, I use the "date -u" command to provide
- >date and time in Greenwitch mean time (Zulu). However, all of our systems
- >are set to Mountain Daylight Time (MDT) which estimates Zulu time one-
- >hour ahead.
-
- The reason why "date -u" would give an incorrect value for UTC would be
- if the system's clock were set incorrectly. All "date" does, when
- invoked with the "-u" flag, is:
-
- 1) get the system time with "gettimeofday()"; the system time
- is, on a properly-set-up system, kept in UTC.
-
- 2) convert that time (represented as seconds+microseconds since
- January 1, 00:00 UTC, 1970) to
- day+month+year+hour+minute+second UTC.
-
- 3) print it out.
-
- If "date" is run with the "-u" flag, it pays no attention whatsoever to
- the time zone for the system, as it doesn't have to.
-
- UNIX systems don't get set to daylight as opposed to standard time; they
- get set up with a particular set of rules for switching between standard
- and daylight time (either by setting the TZ environment variable, or by
- setting a variable in the kernel, or by making a "localtime" link to the
- appropriate time zone file).
-
- If your site is at a location where 1) Mountain Time is the timezone and
- 2) you observe DST according to the standard US rules, you should have
- the system set up for that. In the case of SunOS 4.x, that's done by
- having the "localtime" link be a link to
- "/usr/share/lib/zoneinfo/US/Mountain"; do "zic -l US/Mountain", as
- "root", to do that. (In SunOS 5.x, I think it's done by putting
- "TZ=:US/Mountain" in "/etc/TIMEZONE".)
-
- Then, once you've done that, type "date"; if the time isn't the correct
- local time, then your system's clock is set wrong (which would explain
- why you were getting answers that were off by an hour). Set it
- correctly.
-
- The system will *not* require that you change the date when daylight
- savings time goes into effect, or when it goes out of effect.
-