python学习笔记4-时间函数

1 time

 1 #时间与日期
 2 import time;  # This is required to include time module.
 3 
 4 ticks = time.time()
 5 print ("Number of ticks since 12:00am, January 1, 1970:", ticks)
 6 
 7 localtime = time.localtime(time.time())
 8 print ("Local current time :", localtime)
 9 
10 localtime = time.asctime( time.localtime(time.time()) )
11 print ("Local current time :", localtime)

2 calender

1 import calendar
2 
3 cal = calendar.month(2008, 1)
4 print ("Here is the calendar:")
5 print (cal);
原文地址:https://www.cnblogs.com/lanjianhappy/p/6872557.html