昨天
from datetime import date, timedelta
yesterday = (date.today() + timedelta(days=-1)).strftime("%Y-%m-%d")
print(yesterday)
今天
from datetime import date, timedelta
today = date.today()
print(today)
明天
from datetime import date, timedelta
tomorrow = (date.today() + timedelta(days= 1)).strftime("%Y-%m-%d")
print(tomorrow)
网友评论