from datetime import datetime, timedelta
def main():
print("main.....")
s = '2004-03-30'
date = datetime.strptime(s, "%Y-%m-%d")
print(date.strftime("%Y-%m-%d"))
modified_date = date + timedelta(days=-1)
datetime.strftime(modified_date, "%Y-%m-%d")
print(modified_date.strftime("%Y-%m-%d"))
05-26
762
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-05
1244
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-16
2468
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)