I am trying to format the datetime field(LastCUUpdateDate) returned from query. I tried the solution given by @Suri in Question#73600 here but it turns out to be GMT always. So, posting the question with the piece of code and what I am trying to achieve.
Page:
<apex:page standardcontroller="account" extensions="conts">
{!account.name}
<apex:pageBlock >
<apex:pageBlockTable value="{!contacts}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.id}"/>
<apex:column value="{!c.LastCUUpdateDate }"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
extension class:
public class conts {
public conts(ApexPages.StandardController controller) { }
public string currentRecordId;
public list<contact> getcontacts(){
currentRecordId = ApexPages.CurrentPage().getparameters().get('id');
list<contact> c = [SELECT id, name, LastCUUpdateDate FROM contact WHERE accountId = :currentRecordId];
return c;
}
}
What I am trying to do ? - return datetime field formatted something like Apr 21' 2015 06:53PM