[Edu-sig] How to detect dst problem.

Dustin Mitchell dustin@cs.uchicago.edu
Mon, 29 Oct 2001 15:55:11 -0600 (CST)


On Mon, 29 Oct 2001, Titu Kim wrote:

>    My program does not give correct time reading
> because of day light time saving happened over last
> weekend. I have to mannually add/subtract a -1
> constant everytime this happens. Is there a way that i
> can detect dst change so this add/subtract can happen
> automatically? For instance, i can do an if statement
> to determine what constant should be added when
> computing a time value. Thanks a lot.

Ordinarily, your operating system should detect this and adjust
accordingly.  I would suggest checking & fixing your operating system's
configuration first, then using Python's 'time.localtime()' function,
which incorporates your operating system's knowledge of the time zone,
etc.

Dustin

 -- 

  Dustin Mitchell
  dustin@cs.uchicago.edu
  dustin@ywlcs.org