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

PHOTO EMBED

Fri May 15 2020 09:11:04 GMT+0000 (Coordinated Universal Time)

Saved 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_copyCOPY

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