time, strptime, daylight saving
Malcolm Tredinnick
malcolmt at smart.net.au
Mon Dec 20 06:15:47 EST 1999
On Mon, Dec 20, 1999 at 09:32:20AM +0000, Oleg Broytmann wrote:
[... analysis snipped ...]
> Well, this show that on Solaris and FreeBSD mktime() correctly uses
> is_dst flag; linux ignores it (but produces correct result). In some sense
> FreeBSD and Solaris are doing more correct job.
>
> The question is simple - how can I ask time module whether any given
> date is under daylight saving rule or not? How can I get the value for x
> (in my second variant of the program)?
OK ... I certainly learnt something out of that. Nice diagnostic work! :-)
To answer your question, if you pass a value of -1 as the last element of the
tuple to mktime(), it will fill in the right value from the system's time
zone. I guess that is what you want (use x = -1).
Cheers,
Malcolm Tredinnick
--
I intend to live forever -- so far, so good.
More information about the Python-list
mailing list