fix 正在下载显示剩余下载时间

This commit is contained in:
thsrite
2023-10-27 16:52:47 +08:00
parent 26cd2c6cfe
commit 070481cab0
5 changed files with 22 additions and 1 deletions

View File

@ -63,6 +63,23 @@ class StringUtils:
b, u = d[index]
return str(round(time_sec / (b + 1))) + u
@staticmethod
def str_secends(time_sec: Union[str, int, float]) -> str:
"""
将秒转为时分秒字符串
"""
hours = time_sec // 3600
remainder_seconds = time_sec % 3600
minutes = remainder_seconds // 60
seconds = remainder_seconds % 60
time: str = str(int(seconds)) + ''
if minutes:
time = str(int(minutes)) + '' + time
if hours:
time = str(int(hours)) + '' + time
return time
@staticmethod
def is_chinese(word: Union[str, list]) -> bool:
"""