This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, brian.curtin, docs@python, georg.brandl, napik, techtonik
Date 2011-01-11.14:52:53
SpamBayes Score 4.1257e-09
Marked as misclassified No
Message-id <>
In-reply-to <>
On Tue, Jan 11, 2011 at 4:55 AM, anatoly techtonik
<> wrote:
> I propose the following change:
> -  Nonzero if a DST timezone is defined.
> + .. To check if DST is currently active, use `time.localtime(t).tm_isdst`

This is simply wrong. Your time.localtime(t).tm_isdst expression will
return the DST flag for the POSIX time value t, not for the current
time.  This could be fixed by replacing your proposed expression with
time.localtime().tm_isdst, but why do you think someone  reading about
time.daylight actually wants to "check if DST is currently active"?

What can be improved, though, is the documentation of time.tzset().
The current version fails to mention that  time.tzset() resets the
values of tzname, timezone, altzone and daylight.  This would be the
proper place to document the meaning of all three variables in greater
detail.  Individual entries can then refer to it with say "See
time.tzset() for details."

Here is how POSIX tzset() is defined:

The tzset() function sets the external variable tzname as follows:

tzname[0] = "std";
tzname[1] = "dst";

where std and dst are as described in the XBD specification,
Environment Variables .

The tzset() function also sets the external variable daylight to 0 if
Daylight Savings Time conversions should never be applied for the time
zone in use; otherwise non-zero. The external variable timezone is set
to the difference, in seconds, between Coordinated Universal Time
(UTC) and local standard time.
Date User Action Args
2011-01-11 14:52:57belopolskysetrecipients: + belopolsky, georg.brandl, techtonik, brian.curtin, napik, docs@python
2011-01-11 14:52:53belopolskylinkissue7229 messages
2011-01-11 14:52:53belopolskycreate