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
Fan@EXCFan@EXC 

REST API call always error out: Invalid format

When invoke a REST API (@HttpPost) with some datetime parameter with value: 2013-07-01 17:00:00, the apex class always complains "Invalid format": EXCEPTION_THROWN|[EXTERNAL]|System.JSONException: Invalid format: "2013-07-01 17:00:00" is malformed at " 17:00:00" What is the correct datetime format?
Avidev9Avidev9
Can you post some code ?
Including the JSON that you are sending
SRKSRK
salesforce use "TZ" time format try that
2013-07-01T17:00:00Z Or
2013-07-01T17:00:00
Andrew GilesAndrew Giles
The documentation for SObject Get Updated (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_getupdated.htm) states that it expects ISO-8601, however you get an INVALID_DATE_FORMAT error unless you use the UTC format. See difference below. 

ISO-8601 .   2019-08-14T16:38:39+0000

UTC .   2019-08-14T16:38:39Z

Not sure the best place to suggest documentation updates, but this forum post is what helped me figure it out.