时间模块

import time
print(time.strftime("%Y-%m-%d",time.localtime(1500000000))) # 时间戳转字符串时间
print(time.strptime("2017-03-16","%Y-%m-%d")) # 结构化时间
print(time.mktime(time.strptime("2017-03-16","%Y-%m-%d"))) #字符串时间转时间戳
print(time.mktime(time.strptime("2017-03-16 19:58:2","%Y-%m-%d %H:%M:%S")))
posted @ 2018-12-28 14:11  豆豆妈168  阅读(77)  评论(0)    收藏  举报