Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.sys.att Subject: Re: "daylight" doesn't work on UNIXPC Message-ID: <1084@auspex.UUCP> Date: 27 Feb 89 18:57:56 GMT References: <1667@spp2.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 24 >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 USA Daylight Savings Time conversion should be applied. Said conversion, in recent times, shifts the clock by one hour between the first Sunday in April, 2AM local time, and the last Sunday in October, 2AM local time. Since the current time is not in that range, the clock is not shifted. >The field tm_isdst is correct though (when taken on a time now). Another way of looking at this is that "daylight" is static and "tm_isdst" is dynamic. In other words, "daylight" merely indicates whether your locale *observes* DST, not that DST is *currently* in effect; "tm_isdst" indicates whether DST is in effect for the time converted. I.e., "daylight" probably *does* work on the UNIX PC, and every other version of UNIX running code of that sort; it just doesn't work the way you thought it was supposed to.