import time
# 年4位,月2位,日2位,时2位, 分2位,秒2位
print("{0}{1:0>2d}{2:0>2d}{3:0>2d}{4:0>2d}{5:0>2d}".format(*time.localtime()))
python格式化日期时间自动补0
猜你喜欢
转载自blog.csdn.net/qq_30129009/article/details/126607285
今日推荐
周排行