python获取上周周一日期_python python日期算法 本周,上周,本月,上月,本季,上季,今年, 去年...
import datetime
from datetime import timedelta
now = datetime.datetime.now()
#今天
today = now
#昨天
yesterday = now - timedelta(days=1)
#明天
tomorrow = now + timedelta(days=1)
#当前季度
now_quarter = now.month / 3 if now.month % 3 == 0 else now.month / 3 + 1
#本周第一
原创
2021-06-25 18:58:52 ·
542 阅读 ·
0 评论