Python JSON encoder to support datetime?

后端 未结 9 1889
长发绾君心
长发绾君心 2020-12-03 10:24

is there any elegant way to make Python JSON encoder support datetime? some 3rd party module or easy hack?

I am using tornado\'s database wrapper to fetch some rows

9条回答
  •  渐次进展
    2020-12-03 10:52

    I recommend to use the ujson package or the orjson one.

    They are much faster and still support several complex types.

提交回复
热议问题