[Tutor] Daylight saving time issue

Michael P. Reilly arcege@speakeasy.net
Wed, 7 Nov 2001 08:08:02 -0500


On Tue, Nov 06, 2001 at 09:56:26PM -0800, Titu Kim wrote:
> You have a good point. But the start date and end date
> of dst for every year is different,  how can this
> problem be taken care of. Thanks.

You can know if it IS daylight savings time by looking at the date tuples
returned in the time module.

The last value in the tuple is the DST value (just as with C's struct
time structure).  If it is true, the time is in daylight savings time,
and if false, it is not.  This value can be calculated automatically by
the time module.  If the value is -1, then time.mktime() will guess.

You may also want to look at the mxDateTime package, tho I don't know
how well maintained it is.  I can probably handle it more completely
than the time module.

  -Arcege

-- 
+----------------------------------+-----------------------------------+
| Michael P. Reilly                | arcege@speakeasy.net              |