Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!ditto From: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.sys.att Subject: Re: "daylight" doesn't work on UNIXPC Summary: Yes it does Keywords: TZ timezone localtime Message-ID: <6095@cbmvax.UUCP> Date: 27 Feb 89 22:21:15 GMT References: <1667@spp2.UUCP> Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Organization: Commodore Technology, West Chester, PA Lines: 29 In article <1667@spp2.UUCP> baur@spp2.UUCP (Steven L. Baur) writes: >From the UNIXPC Users Manual Volume II for ctime(3C) >"... the external variable daylight is non-zero if and only if the standard >USA Daylight Savings Time conversion should be applied." > >Why is it one (1) now (it's PST here)? Because the standard conversion rules *should* be applied where you live. `daylight', like `timezone', has nothing to do with the current time, it's just an indication of how the timezone rules work in your area. The standard conversion says that at this time of year, it's Standard time; that's why localtime() will tell you PST. If `daylight' == 0, then localtime() will *never* report DST, no matter what time of year the passed time is within. >The field tm_isdst is correct though (when taken on a time now). Yes, the tm_isdst field reflects whether the given time falls within Daylight Savings Time. `daylight' specifies whether the user's area even has any concept of DST; it's true iff $TZ has nonnumeric characters after the numeric part. -- -=] Ford [=- "The number of Unix installations (In Real Life: Mike Ditto) has grown to 10, with more expected." ford@kenobi.cts.com - The Unix Programmer's Manual, ...!sdcsvax!crash!kenobi!ford 2nd Edition, June, 1972. ditto@cbmvax.commodore.com