import calendar
import datetime
import time
#返回当前时间的时间戳
sk=time.time()
print(sk)
#返回当前时间的struct_time结构
sj=time.localtime()
print(sj)
#将struct_time元组转换成时间戳
sj1=time.mktime((2020,6,1,15,10,5,2,152,0))
print(sj1)
#
sj2=time.strftime("%Y-%m-%d%H:%M:%S",time.localtime())
print(sj2)
#按指定格式将一个时间字符串转换为struct_time元组
sj3=time.strptime("2020-6-1","%Y-%m-%d")
print(sj3)
sj4=datetime.datetime.today()
print(sj4)
#根据时间戳生成datetime对象
sj5=datetime.datetime.fromtimestamp(time.time())
print(sj5)
#将datetime对象进行格式化
sj6=datetime.datetime.now().strftime("%Y-%m-%d")
print(sj6)
#将字符串按照指定格式转换成datetime对象
sj7=datetime.datetime.strptime("2020-6-1","%Y-%m-%d")
print(sj7)
#返回一个多行字符串格式的year年年历,3个月一行,间隔距离为c。 每日宽度间隔为w字符。每行长度为21* W+18+2* C。l是每星期行数
sj8=calendar.calendar(2020,w=2,l=1,c=6)
print(sj8)