"daylight" doesn't work on UNIXPC

Guy Harris guy at auspex.UUCP
Tue Feb 28 04:57:56 AEST 1989


 >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.



More information about the Comp.sys.att mailing list