import time
print(time.time()) #时间戳1553828380.9501994
print(time.localtime(1553828380.9501994))#time.struct_time(tm_year=2019, tm_mon=3, tm_mday=29, tm_hour=10, tm_min=59, tm_sec=40, tm_wday=4, tm_yday=88, tm_isdst=0)年月日时分秒一月中第几周,一年第几天,夏令时
print(time.gmtime(1553828380.9501994))#time.struct_time(tm_year=2019, tm_mon=3, tm_mday=29, tm_hour=10, tm_min=59, tm_sec=40, tm_wday=4, tm_yday=88, tm_isdst=0)
print(time.mktime(time.localtime()))#把struct_time转换为时间戳
print(time.localtime(1553828380.9501994))#把时间戳转化为时间元组
print(time.asctime())#时间元祖转变为时间串 Fri Mar 29 11:10:35 2019
print(time.asctime(time.localtime()))#时间元祖转变为时间串 Fri Mar 29 11:10:35 2019
print(time.ctime())#把时间戳转换为时间串 Fri Mar 29 11:10:35 2019
print(time.ctime(time.time()))#把时间戳转换为时间串 Fri Mar 29 11:10:35 2019
print(time.strftime("%Y-%m-%d, %X",time.localtime())) #把时间元组转换为格式化时间字符串 在这个函数中,format默认为:"%a %b %d %H:%M:%S %Y"。2019-03-29, 11:20:00
print(time.strptime("2019-03-29, 11:20:00","%Y-%m-%d, %X"))#把格式化时间字符串转化为时间元组time.struct_time(tm_year=2019, tm_mon=3, tm_mday=29, tm_hour=10, tm_min=59, tm_sec=40, tm_wday=4, tm_yday=88, tm_isdst=0)