> Programming Languages > Python
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Python



Python - "how to calc the difference between two datetimes?" in Programming Languages


Old 05-09-2005   #1
..ewa.. ..dwint..
 
Default how to calc the difference between two datetimes?

After an hour of research, I'm more confused than ever. I don't know
if I should use the time module, or the eGenix datetime module. Here's
what I want to do: I want to calculate the time difference (in
seconds would be okay, or minutes), between two date-time strings.

so: something like this:
time0 = "2005-05-06 23:03:44"
time1 = "2005-05-07 03:03:44"

timedelta = someFunction(time0,time1)
print 'time difference is %s seconds' % timedelta.

Which function should I use?

confusedly yours,
--
Stewart Midwinter
stewart@midwinter.ca
stewart.midwinter@gmail.com
Skype: midtoad
 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0