You need to sign in to do that
Don't have an account?

Deserialize JSON String Date to DateTime
Hi and thanks in advance.
My goal is to speed up an area of my apex class. I was told that deserializing in a loop causes drag.
I can successfully deserialize a JSON string Date to a DateTime value like this:
Eric
My goal is to speed up an area of my apex class. I was told that deserializing in a loop causes drag.
I can successfully deserialize a JSON string Date to a DateTime value like this:
reportDate= (DateTime)JSON.deserialize('"' + valueMap.get('reportDate') + '"', DateTime.class);I tried using DateTime.valueof like this:
reportDate= datetime.valueof(valueMap.get('reportDate'));Here's the error I get:
Line: 74, Column: 1 System.TypeException: Invalid date/time: 2020-12-28T11:33:31-06:00
Eric
Greetings!
Please refer this for more information related to this error.
https://salesforce.stackexchange.com/questions/247210/system-typeexception-invalid-date-time-2019-01-03t002601-711-0200
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri