"daylight" doesn't work on UNIXPC

Michael "Ford" Ditto ditto at cbmvax.UUCP
Tue Feb 28 08:21:15 AEST 1989


In article <1667 at spp2.UUCP> baur at 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 at kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!kenobi!ford
  2nd Edition, June, 1972.		ditto at cbmvax.commodore.com



More information about the Comp.sys.att mailing list