I have a string as,
field name : start Date: 2016-11-14 08:00 AM ( string type)
how to convert this to Date time. I tried Date.parseDate and below option also.
String val = recruiters[j].Start_Time_Formula__c;
system.debug('val ::'+ val);
DateTime date1 = (DateTime)Json.deserialize('"'+val+'"', DateTime.class);
system.debug('date1 ::' + date1);
but I am getting error as,
System.JSONException: Invalid format: "2016-11-14 08:00 AM" is malformed at " 08:00 AM": (System Code)
I referred the below link and got with the above error.
Convert String DateTime to User Locale Date Time
any help ?