[Error]: Returned Object is not JSON Serializable
How to serialize date time object?
I am trying something like this.
my_date_time = json.dumps(list_of_objects)
list_of_objects variable is the response fro开发者_开发问答m raw query to MYSQL.
Please suggest how to serialize the response having some datetime object in it. Thanks!
thanks to all of you, finaly i have made the solution using CAST(expr AS type) method.
The CAST() function takes an expression of any type and produces a result value of a specified type
SELECT name, CAST(date AS CHAR(10)) FROM table WHERE condition.
thanx to Zack and Hennele Kormano.
精彩评论