>>>import time >>>time.time() 1460599046.85416
>>>import time >>>time.ctime() 'Thu Apr 14 10:03:58 2016' >>> later = time.time()+5 >>> time.ctime(later) 'Thu Apr 14 10:05:57 2016'
>>>import time >>>time.clock() 0.07
import time def show_struct(s): print 'tm_year:", s.tm_year print 'tm_mon:", s.tm_mon print "tm_mday:", s.tm_mday print "tm_hour:",s.tm_hour print "tm_min:", s.tm_min print "tm_sec:", s.tm_sec print "tm_wday:", s.tm_wday print "tm_yday:", s.tm_yday show_struct(time.gmtime()) show_struct(time.localtime())
>>>import time >>>time.timezone/3600 -8
ZONES = ["GMT", "EUROPE/Amsterdam'] for zone in ZONES: os.environ["TZ"] = zone time.tzset()
>>> now=time.ctime() >>> time.strptime(now) time.struct_time(tm_year=2016, tm_mon=4, tm_mday=14, tm_hour=10, tm_min=48, tm_sec=40, tm_wday=3, tm_yday=105, tm_isdst=-1)
>>> from time import gmtime, strftime
>>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
'Thu, 28 Jun 2001 14:17:15 +0000'
>>>from time import mktime, gmtime >>>mktime(gmtime()) 1460573789.0
import time def fucn(): time.sleep(5) print "hello, world"
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有