import datetime
c = datetime.date(2019,9,2)
print(c)
d = datetime.time(17,28,9)
print(d)
a = datetime.datetime.now().timestamp()#当前时间戳
print(a)
b = datetime.datetime.fromtimestamp(a)#再把时间戳转换成时间
print(b)
e = datetime.datetime.now()#获取当前时间
h = datetime.datetime.now().strftime("%y--%m--%d--")#日期对象转字符串
print(h,type(h))
i = datetime.datetime.now().strptime(h,'%y--%m--%d--')#字符串转日期时间对象
print(i,type(i))