📜  python 从日期中减去天数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:35.070000             🧑  作者: Mango

代码示例6
# import datetime module
from datetime import datetime,timedelta

currentTimeDate = datetime.now() - timedelta(10)
subDate = currentTimeDate.strftime('%Y-%m-%d')

print(subDate)

//Output:

2021-12-13