I showing date in email that is in string. I want to convert that into DateTime like(dd-mmm-yyyy hh:mm am/pm). I am trying like DateTime.parse() but it won't work. It's failed and shows the message
"First error: Invalid date/time: 2015-11-05"
My code line is:
string nextDate = (string.valueof(cf.Last_Reviewed_date__c+ integer.valueof(cf.CF_Section__r.CF_Review_Period__c)).substringbefore(' '));
need convert 'nextdate' date to datetime format and show like 'dd-mmm-yyyy hh:mm am/pm' format. nextdate contains "2015-11-05".