Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JSON 只接受以下任何一种数据类型:
字符串、数字、对象(JSON 对象)、数组、布尔值、null
如您所见,时间对象不是其中之一。
您需要使用函数将时间对象转换为字符串,str(some_time_object)然后更新 JSON 字符串。
str(some_time_object)