Re: changing format of time duration.

2010-06-05 Thread Gabriel Genellina
On 4 jun, 06:14, "Günther Dietrich" wrote: > GabrielGenellina wrote: > >Try the strptime method with a suitable format, like this (untested): > >delta = now2-now1 > >delta.strftime('%H:%M:%S.%f') > > Throws an exception: > > |Traceback (most recent call last): > |  File "", line 1, in > |Attribu

Re: changing format of time duration.

2010-06-04 Thread Günther Dietrich
Gabriel Genellina wrote: >Try the strptime method with a suitable format, like this (untested): >delta = now2-now1 >delta.strftime('%H:%M:%S.%f') Throws an exception: |Traceback (most recent call last): | File "", line 1, in |AttributeError: 'datetime.timedelta' object has no attribute 'strft

Re: changing format of time duration.

2010-06-03 Thread Gabriel Genellina
On 3 jun, 17:24, dave wrote: > Quick question. I have to time stamps (now and now2). > > now = datetime.datetime.now(); > now2 = datetime.datetime.now(); > > now2-now1 yields me a result in 0:00:00.11221 (H:MM:SS.) > > I wanted to know if there is a standard python method or a quick hack > to

changing format of time duration.

2010-06-03 Thread dave
Quick question. I have to time stamps (now and now2). now = datetime.datetime.now(); now2 = datetime.datetime.now(); now2-now1 yields me a result in 0:00:00.11221 (H:MM:SS.) I wanted to know if there is a standard python method or a quick hack to add an extra zero in the beginning. So the r