I want to convert milliseconds and have 2:00 output. It should look like duration of the song.
I was trying with this code:
import datetime
seconds = milliseconds/1000
b = int((seconds % 3600)//60)
c = int((seconds % 3600) % 60)
dt = datetime.time(b, c)
print(dt)
>>> 02:30:00
Do you have another ideas? Or maybe I should change something in my code.
Edit: I solved the problem with following code
ms = 194000
seconds, ms = divmod(ms, 1000)
minutes, seconds = divmod(seconds, 60)
print(f'{int(minutes):01d}:{int(seconds):02d}')