time模块

import  time
print(time.time())




#字符串格式化时间给人看的
#时间戳时间---》给计算机看的
#结构化时间---》元组,计算用的

# print(time.strftime("%Y-%m-%d %H:%M:%S"))#年月日时分秒
# print(time.strftime("%m-%d %H:%M:%S"))#月日时分秒
# print(time.strftime("%d %H:%M:%S"))#月日时分秒
# print(time.strftime("%H:%M:%S"))#时分秒


#
# struct_time=time.localtime()
# print(struct_time)
# print(struct_time.tm_year)
#


#时间戳和格式化时间
# t=time.time()
# print(t)
# print(time.localtime(2000000000))
# print(time.gmtime(t))
# print(time.strftime("%Y-%m-%d"),time.localtime(300000000))
print(time.strftime("%m/%d/%y %H:%M:%S",time.localtime(3000000000)))
posted @ 2019-10-19 15:22  小王要变强  阅读(86)  评论(0编辑  收藏  举报