标签:int pre localtime code 运行 sds author alt 模块
1 # Author:CallMeV 2 # DATE :2019-11-10 3 # Time : 12:47 4 5 import time 6 print("time.time()is:>>>",time.time()) 7 print("time.strftime()is:>>>",time.strftime("%Y-%m-%d %H:%M:%S",time.gmtime())) 8 print("time.gmtime()is:>>>",time.gmtime()) #UTC 格林尼治时间 9 print("time.localtime()is:>>>",time.localtime()) 10 print("time.ctime()is:>>>",time.ctime()) 11 12 import datetime 13 print("datetime.datetime.now()is:>>>",datetime.datetime.now())
运行结果如下:
1 time.time()is:>>> 1573361892.4201996 2 time.strftime()is:>>> 2019-11-10 04:58:12 3 time.gmtime()is:>>> time.struct_time(tm_year=2019, tm_mon=11, tm_mday=10, tm_hour=4, tm_min=58, tm_sec=12, tm_wday=6, tm_yday=314, tm_isdst=0) 4 time.localtime()is:>>> time.struct_time(tm_year=2019, tm_mon=11, tm_mday=10, tm_hour=12, tm_min=58, tm_sec=12, tm_wday=6, tm_yday=314, tm_isdst=0) 5 time.ctime()is:>>> Sun Nov 10 12:58:12 2019 6 datetime.datetime.now()is:>>> 2019-11-10 12:58:12.421197
标签:int pre localtime code 运行 sds author alt 模块
原文地址:https://www.cnblogs.com/fly10086/p/11829578.html