考慮下面的例子:奇數輸出在Python
seconds = totalTime % 60
minutes = (totalTime - seconds) % (60 ** 2)
hours = (totalTime - (minutes * 60))/(60 ** 2)
finalTime = '{0:.0f}h {1:.0f}m {2:.0f}s'.format(hours, minutes, seconds)
當我設置TOTALTIME 7000例如(不到兩小時一點點),我得到的回報如下:
-55h 3360m 39s
呵呵!?這種情況與任意數量的數字我給它...如果它有助於繼承人一個例子:
totalTime = 10000
-44h 2760m 39s