📜  日期时间 30 天前 python 代码示例

📅  最后修改于: 2022-03-11 14:47:14.097000             🧑  作者: Mango

代码示例1
from datetime import datetime, timedelta
today = datetime.today()
yesterday = today - timedelta(days=1)
one_week_ago = today - timedelta(days=7)
thirty_days_ago = today - timedelta(days=30)