function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Justin DJustin D 

getting JSON_PARSER_ERROR u'Cannot deserialize instance of date from VALUE_STRING

I am trying to import data from csv file into Salesfoce using Python.
I am trying to import date field with time - for example: 2017-07-24 10:28:00 .
I think I could either use either Date or Date/Time field on Salesforce database, but I am not sure.
On some article, this format (  YYYY-MM-DD hh:mm:ss ) works at either Date or Date/Time field, and some other people are saying, it should work at Date field.
And on some article, it says, it should be "YYYY-MM-DD" only.  
I am confused.

On my login history, this data integration is considered "SOAP Partner under API Type.

So the error message says " u'JSON_PARSER ERROR', u'message': u'Cannot deserialize instance of date from VALUE_STRING value 2017-07-24 10:28:00 or request may be missing a required field at [line:1, column:50

I am not trying to open this csv file in Excel, but just leave it as it is.


  
Justin DJustin D
I found the solution. I need to use either of these formats to work.
 
  • YYYY-MM-DDThh:mm:ssZ
  • YYYY-MM-DDThh:mm:ss.sssZ
Suraj Tripathi 47Suraj Tripathi 47
Hi Justin D,

Greetings!

In salesforce, you can not insert the date as 2017-07-24 10:28:00.
You have to set Date String in proper salesforce format.
like
Opportunity.CloseDate = Date.newInstance(dateString);


If you find your Solution then mark this as the best answer. 

Thank you!

Regards,
Suraj Tripathi