__author__ = 'SPing'


from datetime import date, datetime
from flask.json import JSONEncoder as _JSONEncoder


class JSONEncoder(_JSONEncoder):
    def default(self, obj):
        # 如果o是时间戳
        # datetime.now() ==> datetime.datetime(2020, 4, 8, 9, 4, 57, 26881)
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
        # date.today() ==> datetime.date(2020, 4, 8)
        if isinstance(obj, date):
            return obj.strftime('%Y-%m-%d')
        return super(JSONEncoder).default(obj)

f471bcd5d10c1f7392155ebbf2d48d88176e1acc
<mask token>


class JSONEncoder(_JSONEncoder):
    <mask token>

<mask token>


class JSONEncoder(_JSONEncoder):

    def default(self, obj):
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
        if isinstance(obj, date):
            return obj.strftime('%Y-%m-%d')
        return super(JSONEncoder).default(obj)

__author__ = 'SPing'
<mask token>


class JSONEncoder(_JSONEncoder):

    def default(self, obj):
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
        if isinstance(obj, date):
            return obj.strftime('%Y-%m-%d')
        return super(JSONEncoder).default(obj)

__author__ = 'SPing'
from datetime import date, datetime
from flask.json import JSONEncoder as _JSONEncoder


class JSONEncoder(_JSONEncoder):

    def default(self, obj):
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
        if isinstance(obj, date):
            return obj.strftime('%Y-%m-%d')
        return super(JSONEncoder).default(obj)

__author__ = 'SPing'


from datetime import date, datetime
from flask.json import JSONEncoder as _JSONEncoder


class JSONEncoder(_JSONEncoder):
    def default(self, obj):
        # 如果o是时间戳
        # datetime.now() ==> datetime.datetime(2020, 4, 8, 9, 4, 57, 26881)
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
        # date.today() ==> datetime.date(2020, 4, 8)
        if isinstance(obj, date):
            return obj.strftime('%Y-%m-%d')
        return super(JSONEncoder).default(obj)
