You can use calendar.timegm
to convert your time to seconds since Unix epoch and time.localtime
to convert back:
import calendar
import time
time_tuple = time.strptime("2011-01-21 02:37:21", "%Y-%m-%d %H:%M:%S")
t = calendar.timegm(time_tuple)
print time.ctime(t)
Gives Fri Jan 21 05:37:21 2011
(because I'm in UTC+03:00 timezone).