need a little help with time

Eddie Corns eddie at holyrood.ed.ac.uk
Fri Aug 26 17:34:26 CEST 2005


nephish at xit.net writes:

>Hey there.
>i have a time string (created with strftime) then read from a file,
>i am having some trouble understanding how to get the difference
>between times.
>i know i can structime(timestring) and get a time value, but i dont
>know how to manipulate it.

>basically, if i have string 2005-08-24 09:25:58
>and another string 2005-08-24 09:28:58

>how can i tell how many minutes, hours, seconds, days, months etc..
>have passed between the first string and the second ?

>or, if there is a good tutorial on this kind of thing, please post a
>url.

Either the datetime module or mxDateTime from
  http://www.egenix.com/files/python/mxDateTime.html
which is more extensive.



More information about the Python-list mailing list