startDate = "2018-10-01"
endDate = "2018-10-31"
###字符转化为日期
startTime = datetime.datetime.strptime(startDate, ‘%Y-%m-%d‘).time()
endTime = datetime.datetime.strptime(endDate, ‘%Y-%m-%d‘).time()
now = datetime.datetime.now()
print(now)
###日期转化为字符串
print("--1---:" + datetime.datetime.strftime(startTime, "%Y-%m-%d"))
print("--2---:" + datetime.datetime.strftime(endTime, "%Y-%m-%d"))