Daylight savings time problem

Salsa durieux_br at yahoo.com.br
Wed Mar 26 21:23:23 CET 2008


   I'm sorry, but could you be more specific? How exactly should I use UTC?
 
--
Fabio Durieux Lopes - Salsa

----- Original Message ----
From: D'Arcy J.M. Cain <darcy at druid.net>
To: Fabio Durieux Lopes <durieux_br at yahoo.com.br>
Cc: python-list at python.org
Sent: Wednesday, March 26, 2008 4:49:57 PM
Subject: Re: Daylight savings time problem

 On Wed, 26 Mar 2008 19:37:16 -0000
"Fabio Durieux Lopes" <durieux_br at yahoo.com.br> wrote:
>    I'm trying to execute some operations based on a file's time. The 
> file's time is actually the file's name (e.g. FILE1_20080326170558).
>    So I do this:
>    fileTimeInSecs = time.mktime(time.strptime(timeString, 
> "%Y%m%d%H%M"))
>  
>    timeString contains the date part of the file's name. Function 
> strptime returns a time_struct, but my problem is that tm_isdst is 
> set to 0, and when we enter daylight savings time the file's time is 
> off by 1 hour. This time_struct is also read only so I can't change 
> tm_isdst to -1.
> 
>   Anyone knows how to fix it?

Use UTC.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the Python-list mailing list