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?

  • is +5:30 also part of the string ? Commented Apr 30, 2015 at 12:32

1 Answer 1


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .