Created
February 18, 2021 06:33
-
-
Save alhoo/87a2f7dc6ecc683853ac9742f103db00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import json | |
def dateconverter(o): | |
if isinstance(o, datetime.datetime): | |
return o.__str__() | |
def json_dumps(data): | |
return json.dumps(data, default=dateconverter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment