first commit
This commit is contained in:
commit
ba848e218d
1001 changed files with 152333 additions and 0 deletions
11
Python/几天前日期.py
Normal file
11
Python/几天前日期.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import datetime
|
||||
def getdate(before):
|
||||
# 今天
|
||||
today = datetime.datetime.now()
|
||||
# 偏移
|
||||
offset = datetime.timedelta(days=before)
|
||||
|
||||
# 日期
|
||||
date = (today + offset).strftime('%Y-%m-%d')
|
||||
|
||||
return date
|
Loading…
Add table
Add a link
Reference in a new issue