看起来ujson不允许这样做。ujson只接受3个编码选项:encode_html_chars,ensure_ascii和double_precision。可以使用其他库,例如simplejson,但是看起来ujson是最快的。解决方案:在json序列化之前将python日期时间对象转换为ISO格式的字符串。