def default(self, obj):
        if isinstance(obj, datetime.datetime):
            return int(mktime(obj.timetuple()))
        return json.JSONEncoder.default(self, obj)
Given some Python data, produces JSON output.
dataset/ETHPy150Open kashifrazzaqui/vyked/vyked/utils/jsonencoder.py/VykedEncoder.default--crossover with--dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-tastypie/tastypie/serializers.py/Serializer.to_json