I trying to format "ActivityDateTime" field of Events in apex and trying to display it in html table in lightning using below code:
Event[] nextMeets = [select Id,Subject,ActivityDateTime,ActivityDate from Event where id in :eventIdSet and ActivityDate > today order by ActivityDate asc];
for(Event ev : nextMeets){
String dateformat = ev.ActivityDateTime.format('yyyy-MM-dd HH:mm:ss');
system.debug('checkdatetime' + dateformat);
DateTime dtConverted = Datetime.valueof(dateformat);
System.debug('##dateInStringStringfinal - '+dtConverted);
ev.ActivityDateTime = dtConverted;
system.debug('checkdatefiaaalll' + ev.ActivityDateTime);
FinalNextMeets.add(ev);
}
Here in the debug logs the value of the field "ActivityDateTime" is coming properly formatted like :
##dateInStringStringfinal - 2017-03-30 17:40:00
checkdatefiaaalll2017-03-30 17:40:00
But when i displayed it on Html table using below code:
<tr>
<td class="slds-truncate slds-cell-wrap"> {!cell.ActivityDateTime} </td>
</tr>
its display like this : 2017-03-23T23:31:00.000Z