Ich hatte dazu (min. Python 2.2 ) folgendes Ausgedacht:
Code: Alles auswählen
import time
formtime="2005-07-01 20:00" # (parsed) input from a html form
# convert it to a time struct
timestruct = time.strptime(formtime,"%Y-%m-%d %H:%M")
# convert the time into seconds
temptime = time.mktime(timestruct)
# add one huer
temptime = temptime + 3600
# and convert it back to a timestruct
timestruct = time.localtime(temptime)
# to print out the time (the outout of asctime is also needed by my program)
cstime = time.asctime(timestruct)
print "\n New time:"+cstime
Unter Python 2.3 (SuSE 9.0 / WinXP) passiert das aber nicht. die Variablen time.altzone ,time.daylight,time.timezone sind jeweils glech auf allen Systemen.
Ist das ein Fehler in Python 2.2.1 oder habe ich was falsch verstanden?
gruß,
Carsten
capimin.berlios.de
Mail: cibi bei users.berlios.de