now = datetime.datetime.now()
print(now)
today = datetime.date.today()
print('today={today}'.format(today=today))
2. 和字符串的相互转换
s = now.strftime("%Y-%m-%d%H:%M:%S")
print(s)
s = now.strftime("%Y-%m-%d")
print(s)
date = datetime.datetime.strptime(s, "%Y-%m-%d")
print(date, type(date))