Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

change a decimal to time in datetime python

time = 72.345

hours = int(time)
minutes = (time*60) % 60
seconds = (time*3600) % 60

print("%d:%02d.%02d" % (hours, minutes, seconds))
>> 72:20:42
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #decimal #time #datetime #python
ADD COMMENT
Topic
Name
8+8 =