Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request From: auspex!guy@uunet.uu.net (Guy Harris) Newsgroups: comp.sys.sun Subject: Re: Timezones anyone? Keywords: Miscellaneous Message-ID: <6515@brazos.Rice.edu> Date: 9 Apr 90 17:33:47 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 16 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n116 X-Sun-Spots-Digest: Volume 9, Issue 116, message 7 >I have a function that will take a time structure and return the long >integer representation of that time structure (the reverse of >localtime()), but it requires the tm_isdst to be set. So does SunOS 4.x (the "struct tm" you gave included "tm_zone" and "tm_isgmtoff", so you have 4.x), and theirs *doesn't* require "tm_isdst" to be set - it leaves "tm_isdst" set to the correct value. See the description of "timelocal()" in CTIME(3). (This routine comes with the Arthur Olson time zone code distribution - that's whence the SunOS version came - so other systems may have it as well.) SunOS 4.1 will have the ANSI C "mktime()" routine, which is similar except that you'd have to set "tm_isdst" to -1 to have it figure out whether the time was in DST or not. (That routine comes with the most recent version of the Olson time zone code distribution, and since it's in the ANSI C spec most systems will eventually have it.)