Re: How to convert a timedelta object to a string?

2006-09-14 Thread Bryan Olson
Paul McGuire wrote: > "Carl J. Van Arsdall" wrote: >> Basically I used the datetime module and timedelta objects to calculate a >> difference between two times. Now I'm trying to figure out how I make >> that time delta a string HH:MM:SS to show elapsed time. [...] > From the Python console: >

Re: How to convert a timedelta object to a string?

2006-09-14 Thread skip
>>> startTime = datetime.timedelta(seconds=45,minutes=22,hours=10) >>> stopTime = datetime.timedelta(seconds=25,minutes=2,hours=4) >>> delta = startTime-stopTime >>> time.strftime("%H:%M:%S",time.gmtime(delta.seconds)) '06:20:20' Which, alas, will lose any subsecond resolution

Re: How to convert a timedelta object to a string?

2006-09-14 Thread tobiah
> Well, kinda, although I can work with this, str(tdobject) returns a > string that looks like: > > -1 day, 7:34:32 Oh yeah. I had tried it on a positive timedelta, which does give HH:MM:SS -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/l

Re: How to convert a timedelta object to a string?

2006-09-14 Thread Paul McGuire
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Basically I used the datetime module and timedelta objects to calculate a > difference between two times. Now I'm trying to figure out how I make > that time delta a string HH:MM:SS to show elapsed time. I've s

Re: How to convert a timedelta object to a string?

2006-09-14 Thread Carl J. Van Arsdall
tobiah wrote: > Carl J. Van Arsdall wrote: > >> Basically I used the datetime module and timedelta objects to calculate >> a difference between two times. Now I'm trying to figure out how I make >> that time delta a string HH:MM:SS >> >> >> > > Oddly enough, str(tdobject) does what you

Re: How to convert a timedelta object to a string?

2006-09-14 Thread tobiah
Carl J. Van Arsdall wrote: > Basically I used the datetime module and timedelta objects to calculate > a difference between two times. Now I'm trying to figure out how I make > that time delta a string HH:MM:SS > > Oddly enough, str(tdobject) does what you want. -- Posted via a free Usenet

How to convert a timedelta object to a string?

2006-09-14 Thread Carl J. Van Arsdall
Basically I used the datetime module and timedelta objects to calculate a difference between two times. Now I'm trying to figure out how I make that time delta a string HH:MM:SS to show elapsed time. I've spent tons of time looking at the module's documentation but I'm not seeing how those me