def date_default(obj):
    if isinstance(obj, datetime):
        return obj.strftime(ISO8601)
    else:
        raise TypeError("%r is not JSON serializable"%obj)
default function for packing datetime objects in JSON.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/utils/jsonutil.py/date_default