Home

I am getting results like these with the time module:

>>> import time
>>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M
%S')))
1173610800
>>> int(time.mktime(time.strptime('2007-03-11 03:00:00', '%Y-%m-%d %H:%M
%S')))
1173610800
>>> time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(1173610800))
'2007-03-11 03:00:00'

I know it probably has something to do with daylight savings, but how can I
get back out that which I put in? The times concerned are all standard
time, so how can I keep the time module from asserting its belief that I
want to convert to daylight savings?

Incidentally, it only happens with times on 2007-03-11 from 02:00:00 to
02:59:59, and not with time data from past years.

Thanks for any pointers!

j

--
Joshua Kugler
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE

previous
next

Re: how to use if else macro while compilation
database persistence with mysql, sqlite
Re: migrating to packages
Re: What does the syntax [::-1] really mean?
error: must use '.*' or '->*' to call pointer-to-member function in '__unary_op (...)'
Rodzic Po Ludzku
Fundacja Hobbit
Mam Marzenie
Mimo Wszystko
Kidprotect