Answers for "json dumps datetime"

2

json dumps datetime

def myconverter(o):
    if isinstance(o, datetime.datetime):
        return o.__str__()

print(json.dumps(d, default = myconverter))
Posted by: Guest on June-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language