标签:ar sp on 2014 cti bs 时间 as python
获取时间
>>> import time >>> ticks=time.time() >>> print(ticks) 1415277557.990928 >>> localtime=time.localtime(ticks) >>> print(localtime) time.struct_time(tm_year=2014, tm_mon=11, tm_mday=6, tm_hour=20, tm_min=39, tm_sec=17, tm_wday=3, tm_yday=310, tm_isdst=0) >>> time.asctime(localtime) ‘Thu Nov 6 20:39:17 2014‘
time.asctime(time.localtime(time.time()))
2. 获取日历
>>>import calendar >>> print(calendar.month(2008,1)) January 2008 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
标签:ar sp on 2014 cti bs 时间 as python
原文地址:http://my.oschina.net/hanruikai/blog/341602