mirror of
https://github.com/openspug/spug.git
synced 2026-01-18 14:54:28 +00:00
10 lines
282 B
Python
10 lines
282 B
Python
def seconds_to_human(seconds):
|
|
text = ''
|
|
if seconds > 3600:
|
|
text = f'{int(seconds / 3600)}小时'
|
|
seconds = seconds % 3600
|
|
if seconds > 60:
|
|
text += f'{int(seconds / 60)}分钟'
|
|
seconds = seconds % 60
|
|
return f'{text}{int(seconds)}秒'
|