Breaking

Code Gripper
Responsive Advertisement
  • Home
Home

TypeError: Object of type date is not JSON serializable

byMahabubur Rahman -January 02, 2022
0

 


data = [{'date': datetime.date(2021, 12, 13), 'code': '668561B6DBF1CB7AB'},{'date': datetime.date(2021, 12, 11), 'code': '668561B6DBF1CB7CD'}]

import json
json.dumps(data,  sort_keys=True, default=str)
'[{"code": "668561B6DBF1CB7AB", "date": "2021-12-13"},{"code": "668561B6DBF1CB7CD", "date": "2021-12-11"}]'





  • Facebook
  • Twitter

You may like these posts

Post a Comment

Previous Post Next Post

Follow Us

Popular Posts

TypeError: Object of type date is not JSON serializable

byMahabubur Rahman-January 02, 2022

Remove duplicate values from JS array

January 03, 2022

ModuleNotFoundError: No module named 'ckeditor_uploader'

September 13, 2022

Django - cannot import name 'config' from 'decouple'

January 10, 2023

Subscribe Us

Facebook

Categories

Main Tags

Code Gripper

September 30, 2023

Total Pageviews

Search This Blog

CODE GRIPPER

Code Gripper
CODE GRIPPER

  • Home
  • Python
  • PHP

Menu Footer Widget

  • Home
  • About
  • Contact Us
Code Gripper

About Us

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.

Categories

Main Tags

Latest Posts

Most Popular

TypeError: Object of type date is not JSON serializable

January 02, 2022

Remove duplicate values from JS array

January 03, 2022

ModuleNotFoundError: No module named 'ckeditor_uploader'

September 13, 2022
Design by Blogger | Distributed by Gooyaabi
  • Home
  • About Us
  • Contact Us
  • RTL Version

Contact Form