import datetime
from datetime import timedelta
def get_current_week():
fmt = lambda x: datetime.datetime.strftime(x, "%Y-%m-%d")
today = datetime.date.today()
monday = today - timedelta(days=today.weekday())
return [fmt(monday + timedelta(days=i)) for i in range(7)]
print(get_current_week())
Python: obtiene la fecha de esta semana.
Supongo que te gusta
Origin blog.csdn.net/weixin_44634704/article/details/132458699
Recomendado
Clasificación