摘要: 方法一: def seconds_to_hms(seconds_num): """ 输入秒数 转换为 时分秒输出 param: seconds_num integer 666 return: hms str 00:00:00 """ m, s = divmod(seconds_num, 60) h, 阅读全文
posted @ 2022-04-12 22:58 白云~ 阅读(2405) 评论(0) 推荐(0) 编辑
摘要: 方法一: 先用timedelta.total_seconds(x)将timedelta转换为秒,再用strftime('%H:%M:%S',gmtime(x)))将秒转换为时分秒格式 例: from time import gmtime from time import strftime impor 阅读全文
posted @ 2022-04-12 22:24 白云~ 阅读(7161) 评论(0) 推荐(0) 编辑