我必须将日期值作为变量传递。这是我的代码来计算当前的mnth和prev。第十
import datetime
today = datetime.date.today()
Curr_Mnth=datetime.date(day=1,month=today.month,year=today.year)
Prev_Mnth=Curr_Mnth - datetime.timedelta(days=1)
c=str(Curr_Mnth.strftime("%Y%m%d"))
p=str (Curr_Mnth.strftime("%Y%m%d"))
我希望传递c和p的值
ENDPOINT_site_totals = '/sites/site_totals?DateStamp=gte:"c":+AND+lt:"p"'
任何人都可以帮助我。
答案 0 :(得分:0)
ENDPOINT_site_totals = '/sites/site_totals?DateStamp=gte:"{0}":+AND+lt:"{1}"'.format(c, p)