-
Notifications
You must be signed in to change notification settings - Fork 578
Closed
Description
Since JSON is the default serilization format for TinyDB there's the datetime problem:
>>> from tinydb import TinyDB
>>> from datetime import datetime
>>> db = TinyDB("db.json")
>>> db.insert({"date": datetime.now()})
...
TypeError: datetime.datetime(2015, 2, 21, 17, 24, 17, 828569) is not JSON serializable
Many other databases handle datetime conversion for the user, and I would very much like TinyDB to do the same (It's usually fixed by specifying a custom encoding and a corresponding decoder when reading from the database).
Do you think this is a good idea?
Sbrjt
Metadata
Metadata
Assignees
Labels
No labels