How to calculate two time?

skip at skip at
Thu Oct 9 13:20:17 CEST 2008

    lookon> Thank you for your help.It works.  However, I am using Google
    lookon> App Engine and cannot import dateutil and epsilon.

I don't know how Google App Engine works, but are you not able to install
pure Python modules?

    lookon> Are there any other ways?

Take a look at the time.strptime function to generate a tuple, then use

    t = time.strptime(timestamp, format)
    t1 = datetime.datetime(*t[0:6])

Note that with this solution you will have to handle the timezone offset


More information about the Python-list mailing list