How to overcome “datetime.datetime not JSON serializable”?

后端 未结 30 2741
梦谈多话
梦谈多话 2020-11-22 03:31

I have a basic dict as follows:

sample = {}
sample[\'title\'] = \"String\"
sample[\'somedate\'] = somedatetimehere
         


        
30条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 03:51

    Convert the date to string

    date = str(datetime.datetime(somedatetimehere)) 
    

提交回复
热议问题