欢迎来到贱贱的博客

扩大
缩小

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);

 

posted on 2017-05-18 11:42  L的存在  阅读(190)  评论(0编辑  收藏  举报

导航