当前的时间上加一天或一年减一天等操作
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from datetime import datetime,timedelta
now = datetime.now()
yestoday = now - timedelta(days=1)
tommorow = now + timedelta(days=1)
next_year = now + timedelta(days = 365)
当前的时间上加一天或一年减一天等操作
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from datetime import datetime,timedelta
now = datetime.now()
yestoday = now - timedelta(days=1)
tommorow = now + timedelta(days=1)
next_year = now + timedelta(days = 365)
下一篇:Python 与 SQLite
FastAPI 构建高效的 Python Web
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M