How can I convert string 2015-04-15T12:48:00+05:30 to Salesforce DateTime format? And also adjust the Timezone to be set to GMT +05:30?


Try JSON.deserialize:

dt = (Datetime)json.deserialize('"2015-04-15T12:40:00+05:30"', datetime.class);

Note the double quotes inside the single quotes to make the date string a valid JSON date. That function should deserialize ISO-8601 datetime strings.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.