bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extern int daylight different from tm.tm_isdst


From: Petr Vandrovec
Subject: Re: extern int daylight different from tm.tm_isdst
Date: Thu, 24 Apr 2003 21:49:20 +0200

On 24 Apr 03 at 13:59, Mikhail Kruk wrote:
> This probably is a documentation bug. According to localtime man page, 
> daylight variable should indicate whether we are in daylight savings time. 
> Unlike ftime man page it doesn't say that this is broken. However if I set 
> my date to Apr 2 2003 which is before dst, daylight still has a value of 
> 1. localtime() returns tm.tm_isdst correctly (0).

Which documentation you read? Mine tzset manpage (man daylight) says 
at the end of the first paragraph:

... and daylight (0 if this time zone does not have any daylight
savings time rules, nonzero if there is a time during year when
daylight savings time applies).

In short: tm_isdst has nothing to do with daylight. Most simillar
to the daylight variable is (quite useless) value returned by 
gettimeofday in timezone's tz_dsttime (which should be always zero
on Linux, according to the gettimeofday manpage). Both tz_dsttime
and daylight are legacy things defined as "do not use" in last 17
years.
                                            Best regards,
                                                Petr Vandrovec
                                                address@hidden
                                                





reply via email to

[Prev in Thread] Current Thread [Next in Thread]