from datetime import date, timedelta
yesterday = (date.today() + timedelta(days=-1)).strftime("%Y-%m-%d")
print(yesterday)
03-29
578
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
from datetime import date, timedelta
yesterday = (date.today() + timedelta(days=-1)).strftime("%Y-%m-%d")
print(yesterday)