Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

TypeError: Object of type date is not JSON serializable

json.dumps(my_dictionary, indent=4, sort_keys=True, default=str)
Comment

Object of type datetime is not JSON serializable

#Convert the date to a string

sample['somedate'] = str( datetime.utcnow() )
Comment

PREVIOUS NEXT
Code Example
Python :: remove items from list while iterating python 
Python :: python string [::-1] 
Python :: how to add find the smallest int n in a list python 
Python :: python time a task 
Python :: multithreaded programming in python 
Python :: python send email from icloud 
Python :: How to change application icon of pygame 
Python :: class variable in python 
Python :: python second element of every tuple in list 
Python :: how to store something in python 
Python :: max of empty list python 
Python :: embeds discord.py 
Python :: create instances of a class in a for loop 
Python :: can u length a dictionary in python 
Python :: python stop stdout 
Python :: pyad create user 
Python :: python popen 
Python :: container with most water python code leetcode 
Python :: remove rows from a dataframe that are present in another dataframe? 
Python :: pandas convert hex string to int 
Python :: discord embed python 
Python :: python sys environment 
Python :: datetime to timestamp 
Python :: python calculate the power of number 
Python :: Query a PSQL Database From Python 
Python :: hill cipher 
Python :: How to remove case sensitive django filter 
Python :: python digit string 
Python :: python get time executed by function 
Python :: pandas pull value from column 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =