最常用的time模块功能
import time now_time = time.localtime() print(now_time) format_time = time.strftime(‘%Y-%m-%d %H:%M:%S‘,now_time) print(format_time)
time.localtime():获取本地时间
time.localtime(时间戳):显示为时间戳对应时间
time.strftime(‘格式化输出’,需要被格式化的时间)
原文:https://www.cnblogs.com/likeye/p/11210049.html