How do I convert seconds to hours, minutes and seconds?

前端 未结 12 2096
执笔经年
执笔经年 2020-11-22 11:00

I have a function that returns information in seconds, but I need to store that information in hours:minutes:seconds.

Is there an easy way to convert the seconds to

12条回答
  •  无人及你
    2020-11-22 11:36

    
    division = 3623 // 3600 #to hours
    division2 = 600 // 60 #to minutes
    print (division) #write hours
    print (division2) #write minutes
    

    PS My code is unprofessional

提交回复
热议问题