You need to sign in to do that
Don't have an account?

Displaying Date in mm/dd/yyyy format in VF page
Hi All,
When I use following code I see date in "Wed Feb 11 00:00:00 GMT 2009" format
<apex:column width="10%"> <apex:facet name="header"> <apex:commandLink action="{!search}" value="Close Date" id="cmdSort2"> <apex:param value="o.CloseDate" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <apex:outputLabel value="{!opp.CloseDate}" /> </apex:column>
When I use
<apex:column value="{!opp.CloseDate}" width="10%"/>
, it displays date in "mm/dd/yyyy" .
What I need to do to display date in "mm/dd/yyyy" format using outputLabel?
Are there any functions in Visualforce expression to support this..
Thanks,
Deepak
Can you use apex:outputText instead?
<apex:page standardController="Opportunity"> <apex:outputText value="{0,date,MM/dd/yy}"> <apex:param value="{!opportunity.CloseDate}" /> </apex:outputText> </apex:page>
That should give you the results you want.
All Answers
Can you use apex:outputText instead?
<apex:page standardController="Opportunity"> <apex:outputText value="{0,date,MM/dd/yy}"> <apex:param value="{!opportunity.CloseDate}" /> </apex:outputText> </apex:page>
That should give you the results you want.
Still helping ten years on!
Deepakp
<apex:page standardController="Opportunity">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection>
<apex:inputField value="{!opportunity.CloseDate}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks,
Manoj