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
harshasfdcharshasfdc 

date format on visual force page

Hi All,

 

i want to format the date in a column in pageblock table which is being retrived from aggrigate result .i am getting the result as "2009-06-30 00:00:00" i just want to show only date"2009-06-30" insed of time.is their any way to this 

 

Thanks,

Harsha

Best Answer chosen by Admin (Salesforce Developers) 
@anilbathula@@anilbathula@
Hi harshasfdc

Check this link for detailed information on display of date format in the visual force.

http://christopheralunlewis.blogspot.in/2010/08/displaying-different-date-formats-on.html

All Answers

pjcloudpjcloud

Hi Harsha,

 

The Visualforce standard component reference talks about this precise example for the apex:outputText component. 

 

See here: 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm

 

Essentially, you will be binding your agg result field value to a parameter nested inside an output text and then using formatting to match your desired date format. 

 

In the example in the link, replace the NOW() call with the binding to your aggregate result date <apex:param value="{!myDateVal}"/>

venkateshyadav1243venkateshyadav1243

Hi

 

You can try like these

 

 

<apex:outputText value=”{0,date,MM’/'dd’/'yyyy}”>
<apex :param value=”{!contact.Birthdate}” />

 

 

 

Regards

Venkatesh

 

@anilbathula@@anilbathula@
Hi harshasfdc

Check this link for detailed information on display of date format in the visual force.

http://christopheralunlewis.blogspot.in/2010/08/displaying-different-date-formats-on.html

This was selected as the best answer