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
AbAb 

VF | display only date instead of date time

Hello,

I have a VF page which displayes date like below
2016/12/19 14:34:54 GMT
But i want to display like 2016/12/19

Thank you for suggestion !
Best Answer chosen by Ab
AnjunaAnjuna
Hi Sandrine,
Please see the below example
<apex:outputText value="{0,date,yyyy/MM/dd}">
<apex:param value="{!dateVariable}" />
</apex:outputText>

All Answers

Rahul_kumar123Rahul_kumar123
Hi Sandrine,
  • Please check the below VF code to only display date.
<apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> 
<apex:param value="{!contact.Birthdate}" />
 </apex:outputText>
Refer the below link for further reference.  I hope it will be helpful.

Please mark it as best answer if it resolved your issue.

BestRegards
RahulKumar
AnjunaAnjuna
Hi Sandrine,
Please see the below example
<apex:outputText value="{0,date,yyyy/MM/dd}">
<apex:param value="{!dateVariable}" />
</apex:outputText>
This was selected as the best answer