changing format of time duration.

dave davidreynon at gmail.com
Thu Jun 3 16:24:44 EDT 2010


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.ssss)

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 result I am looking for would be 00:00:00.11221



More information about the Python-list mailing list