Hi, I've googled around extensively to try figure this out assuming it should be straight forward (and it probably is) but I'm clearly missing something.
I'm trying to get the total run time of the program but have the final time being displayed in a particular format. I.e. without the seconds in milliseconds decimal points and just to customize it a bit more. import time from datetime import datetime startTime = datetime.now() time.sleep(5.1564651443644) endTime = datetime.now() exe_time = endTime-startTime print type(startTime) print type(endTime) print type(exe_time) print "startTime: ", startTime print "endTime:", endTime print "exe_time: ", exe_time #how to format this to "D Days, HH: MM: SS" ? #exe_time: 0:00:05.156000 #desired 0 Days, 0h: 00:m: 05s Thanks in advance, Jignesh
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor