Python_time模块

1.time模块中获取时间常用的方法:time(), ctime(),localtime()

2.格式化时间的方法:strftime()

import time

print(time.time())

print(time.ctime())

print(time.localtime())

#时间格式化
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime()))
原文地址:https://www.cnblogs.com/myfy/p/11711857.html