python中datetime的使用方法
from datetime import *
#date模块中的today()函数
now = date.today()
print(now)
print(now.year)
print(now.month)
print(now.day)
print(now.isoweekday())
print(" ")
#date模块中的timedelta函数
print(now+timedelta(days=1))
print(now-timedelta(days=1))
print(now+timedelta(days=7))
print(" ")
#datetime中的now()和today()函数
print(datetime.now())
print(datetime.today())
print(" ")
now = datetime.now()
print(now.date())
print(now.time())
print(now+timedelta(days=1))