function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Divya SDivya S 

Date format in pageblocktable

Hello, 

I am trying to display the createddate field in '01/01/2014' format in visualforce page in <apex:column>.  I tried various options which didn't work.  Can anyone help?
Best Answer chosen by Divya S
Divya SDivya S
hi Ramu,


I somehow managed to find a solution and hence try your soltuion.  Appreciate your response though !

                   <apex:column headerValue="Created Date" >
                     <apex:outputText value="{0,date,MM/dd/yyyy}">
                           <apex:param value="{!t.createdDate}" />
                       </apex:outputText>
                    </apex:column>


All Answers

Ramu_SFDCRamu_SFDC
Here is the sameple code on how you can get the required dateformat on visualforce page

<apex:page standardcontroller="travel__c">
<apex:dataTable value="{!travel__c}" var="travel">
<apex:column headerValue="created date">
<apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
    <apex:param value="{!travel__c.createddate}" />
</apex:outputText> 
</apex:column>
</apex:dataTable>
</apex:page>

Please mark this as a solution if this resolved your issue.
Divya SDivya S
hi Ramu,


I somehow managed to find a solution and hence try your soltuion.  Appreciate your response though !

                   <apex:column headerValue="Created Date" >
                     <apex:outputText value="{0,date,MM/dd/yyyy}">
                           <apex:param value="{!t.createdDate}" />
                       </apex:outputText>
                    </apex:column>


This was selected as the best answer