Object of type datetime is not JSON serializable 444444444444 code example
Example: object of type 'datetime' is not json serializable
from datetime import datetime
import json
class DateTimeEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
return json.JSONEncoder.default(self, o)