You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
344 B
17 lines
344 B
# encoding: utf-8
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
# 获取当日日期
|
|
def get_cur_date():
|
|
date = datetime.today()
|
|
date = date.strftime('%Y.%m.%d')
|
|
return date
|
|
|
|
|
|
# 获取前n日的日期
|
|
def get_pre_n_date(n=1):
|
|
predate = datetime.today() + timedelta(-n)
|
|
predate = predate.strftime('%Y.%m.%d')
|
|
return predate
|