class MyEncoder(json.JSONEncoder):

    def default(self, obj):
        if isinstance(obj, datetime.datetime):
            pass
Why does json serialization of datetime objects in python not work out of the box for datetime objects