🔖

Pythonで先週の開始と終了の日付取得

2022/03/07に公開約100字
from datetime import timedelta, date
today = date.today()
last_monday = today - timedelta(days=(7 + today.weekday()))
this_monday = today - timedelta(days=(today.weekday()))

Discussion

ログインするとコメントできます