time/strptime/mktime/localtime

Oleg Broytmann phd at sun.med.ru
Wed Nov 10 14:35:54 CET 1999


Hello!

   The following program prints "1999-09-21 21:44:33" on Linux and
"1999-09-21 22:44:33" on Solaris (1 hour offset).

   Is it a problem with my config? libs? python? Timezone is Europe/Moscow,
set (I think) correctly on both systems.

#! /usr/local/bin/python -O

import time

t = time.strptime("1999-09-21 21:44:33", "%Y-%m-%d %T")
m = time.mktime(t)
print time.strftime("%Y-%m-%d %T", time.localtime(m))

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list