时间函数(秒转为特定格式)
时间:2017-10-23 23:35:43
收藏:0
阅读:253
def make_readable(seconds):
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
return ‘%02d:%02d:%02d‘ % (h,m,s)
divmod函数:本函数是实现a除以b,然后返回商与余数的元组。
原文:http://www.cnblogs.com/dreamyu/p/7602889.html
评论(0)