lundi 21 juin 2021

Post datetime variable from form html to python

I use flask ! I try to get variables from html form to run my python code ! here some line of my code .

   datevisu = request.form['datevisua']
   dates = np.array([x.replace(tzinfo=None) for x in eopatch.timestamp])
   date = datetime.datetime(datevisu)
   closest_date_id = np.argsort(abs(date-dates))[0]

I get this error !

TypeError: an integer is required (got type str)

Any help please !




Aucun commentaire:

Enregistrer un commentaire