# 字符串时间《strftime===strptime》结构化时间《gmtime=====mktime》时间戳
# t = time.time()
# print(t)
# print(time.localtime(3000000000)) 结构化本地时间
# print(time.gmtime(t)) 时间戳转结构化
# print(time.mktime(time.localtime())) 本地结构化转时间戳
# print(time.strptime('2000-12.31','%Y-%m.%d')) 固定时间砖结构化
# print(time.strftime('%m/%d/%Y %H:%M:%S',time.localtime(3000000000)))固定化的结构时间转字符串
#结构化时间 --> %a %b %d %H:%M:%S %Y串
#time.asctime(结构化时间) 如果不传参数,直接返回当前时间的格式化串
# >>>time.asctime(time.localtime(1500000000))
# 'Fri Jul 14 10:40:00 2017'
# >>>time.asctime()
# 'Mon Jul 24 15:18:33 2017'
# #时间戳 --> %a %b %d %H:%M:%S %Y串
# #time.ctime(时间戳) 如果不传参数,直接返回当前时间的格式化串
# >>>time.ctime()
# 'Mon Jul 24 15:19:07 2017'
# >>>time.ctime(1500000000)
# 'Fri Jul 14 10:40:00 2017'
计算时间差
t1 = time.mktime(time.strptime('2000-12.31','%Y-%m.%d'))
# print(t1)
# t2 = time.mktime(time.localtime())
# print(t2)
# dif_time = t2 -t1
# t3 = time.gmtime(dif_time)
# # print(t3)
# print("过去了%d年%d月%d日%d小%d时%d分"%(
# t3.tm_year -1970,
# t3.tm_mon -1,
# t3.tm_mday- 1,
# t3.tm_hour,
# t3.tm_min,
# t3.tm_sec,
#
# ))