I am trying to use Flask-Ask and create an Alexa skill. I am getting issue while storing date and time into json
Below is the error
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.date(2018, 6, 12) is not JSON serializable
Below is the code snippet
@ask.intent("BookDateConfirmIntent")
def booking_confirmed(confirm_date):
start_date = session['attributes']['startDate']
data = {'services': '1234a', 'startDate': start_date, 'message': 'booking confirmed'}
print json.dumps(data, indent=4, sort_keys=True, default=str)
The date being passed is like 2018-06-12
I read that we need to serialize this and I am not able to get it working correctly for the above code requirement. Someone please help. Thanks