Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!bbn!mit-eddie!uw-beaver!rice!sun-spots-request From: dupuy@columbia.edu (Alexander Dupuy) Newsgroups: comp.sys.sun Subject: Re: Changing Timezones in SunOS 4.0 Message-ID: <8901032358.AA01329@cs.columbia.edu> Date: 11 Jan 89 06:06:04 GMT Sender: usenet@rice.edu Organization: Eikonix Corp., Bedford, MA Lines: 36 Approved: Sun-Spots@rice.edu Original-Date: Tue, 3 Jan 89 18:58:10 EST X-Sun-Spots-Digest: Volume 7, Issue 94, message 3 of 13 One of the really nice things about 4.0 is that Sun has incorporated Arthur Olson's timezone code, which makes it possible to change the system's notion of the local timezone without even rebooting! To change the local timezone, just rm /usr/lib/zoneinfo and link it to the appropriate file, e.g.: amsterdam# date Tue Jan 3 17:54:40 EST 1989 amsterdam# rm /usr/lib/zoneinfo/localtime amsterdam# ln /usr/lib/zoneinfo/Navajo /usr/lib/zoneinfo/localtime amsterdam# date Tue Jan 3 15:55:53 MST 1989 amsterdam# rm /usr/lib/zoneinfo/localtime amsterdam# ln /usr/lib/zoneinfo/US/Eastern /usr/lib/zoneinfo/localtime amsterdam# date Tue Jan 3 17:56:27 EST 1989 Of course, the various daemons may be running in the old timezone, so you might want to go to single-user (via shutdown) and then back to multi-user after doing this. Actually, now that I've looked at the manual page, I see I could have used the commands "/usr/etc/zic -l Navajo" and "zic -l US/Eastern" to do the same thing more easily (and portably). You can even create new timezones using zic. You can look at the file /usr/share/lib/zoninfo/australasia and modify it as needed, then run zic on it. This stuff is really neat if you're into obscure time-related trivia, like me. The only things which the Sun stuff doesn't handle are solar time (they compiled the code with NOSOLAR defined, argh) and leap seconds, for which support was added in a later version of Olson's code (now in 4.3-tahoe). @alex