0 points

python - Passing a date as a URL parameter to a flask route - Stack Overflow


dashboard

Fri May 15 2020 09:11:04 GMT+0000 (UTC)

Posted by @salitha.pathi #python

def toDate(dateString): 
    return datetime.datetime.strptime(dateString, "%Y-%m-%d").date()

@app.route()
def event():
    ektempo = request.args.get('start', default = datetime.date.today(), type = toDate)
    ...
content_copy Copy

https://stackoverflow.com/questions/53460391/passing-a-date-as-a-url-parameter-to-a-flask-route