代码
import time
# 时间戳
timestamp = time.time()
print(timestamp)
# 根据 %Y-%m-%d %H:%M.%S格式 输出日期
date = time.strftime('%Y-%m-%d %H:%M.%S', time.localtime(timestamp))
print(date)
运行结果
最后
以上就是紧张毛巾最近收集整理的关于Python -- 时间戳转换为标准日期时间代码运行结果的全部内容,更多相关Python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复