simplejson decoder for a python script
I am trying to parse the code with simplejson using a python script.
{ "name":"some",
"products_valid_time_from":2011-08-01开发者_开发问答T14:45:00,
"products_valid_time_to":2011-08-01T21:00:00,
}
Ia m getting an error
simplejson.decoder.JSONDecodeError: Expecting , delimiter: line 2 column 34 (char 52)
Can some one help me with this?
Dates are not part of JSON. See for example this blog entry.
Your dates need to be in quotes. It's just another string to the JSON parser.
The format is wrong.
You can follow this json rule
You can save your date as string first. Then when you retrieve that value, you can use alternative library to convert string into date.
精彩评论