Dec-07-2016, 02:58 PM
If the number is a number, you could also try
time_stamp = 144345.20 string_time = str(time_stamp) # Convert number to a string hours = string_time[0:2] minutes = string_time[3:5] sec = string_time[4:] print("{} hours {} minutes {} seconds".format(hours, minutes, sec))resulting in:
Output:14 hours 34 minutes 45.2 seconds
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition