import time
import random
#日期转换成元组
begin=(2021,9,1,0,0,0,0,0,0) #后面3个填写要求范围内的任意数字
end=(2021,12,31,23,59,59,0,0,0)
#将时间元组转化成时间戳
dbegin=time.mktime(begin)
dend=time.mktime(end)
#随机取值
date_list=[]
for i in range(int(dbegin),int(dend),86400):
date=time.strftime("%Y%m%d",time.localtime(i))
date_list.append(date)
','.join(date_list)