ViaThinkSoft CodeLib
This article is in:
CodeLib → Programming aids → Python
def hms_string(sec_elapsed):
h = int(sec_elapsed / (60 * 60))
m = int((sec_elapsed % (60 * 60)) / 60)
s = sec_elapsed % 60
return "{}:{:>02}:{:>05.2f}".format(h, m, s)
Daniel Marschall
ViaThinkSoft Co-Founder
ViaThinkSoft Co-Founder