4.12. Date & Time
Last updated
Was this helpful?
Was this helpful?
import time #time module을 위해 필요한 모듈.
ticks = time.time()
print("1970년 1월 1일 오전 12시 이후의 Tick 숫자:", ticks)
localtime = time.localtime(time.time())
print("Local 현재 시간 :", localtime)
localtime = time.asctime(time.localtime(time.time()))
print("Local 현재 시간 :", localtime)
1970년 1월 1일 오전 12시 이후의 Tick 숫자: 1552554699.0884836
Local 현재 시간 : time.struct_time(tm_year=2019, tm_mon=3, tm_mday=14, tm_hour=18, tm_min=11, tm_sec=39, tm_wday=3, tm_yday=73, tm_isdst=0)
Local 현재 시간 : Thu Mar 14 18:16:04 2019import time;
localtime = time.asctime( time.localtime(time.time()) )
print "Local current time :", localtimeimport calendar
cal = calendar.month(2019, 1)
print(cal)March 2019
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 31time.altzone
time.asctime([tupletime])
time.clock( )
time.ctime([secs])
time.gmtime([secs])
time.localtime([secs])
time.mktime(tupletime)
time.sleep(secs)
time.strftime(fmt[,tupletime])
time.strptime(str,fmt='%a %b %d %H:%M:%S %Y')
time.time( )
time.tzset()
time.timezone
time.tznamecalendar.calendar(year,w=2,l=1,c=6)
calendar.firstweekday( )
calendar.isleap(year)
calendar.leapdays(y1,y2)
calendar.month(year,month,w=2,l=1)
calendar.monthcalendar(year,month)
calendar.monthrange(year,month)
calendar.prcal(year,w=2,l=1,c=6)
calendar.prmonth(year,month,w=2,l=1)
calendar.setfirstweekday(weekday)
calendar.timegm(tupletime)
calendar.weekday(year,month,day)