1

I need this date format in a visualforce page as MM/dd/yy, below is the code. But in page it display as Fri Mar 08 00:00:00 GMT 201903/08/19, Can you please help me on this?

<apex:commandLink value="{!a.Date__c}" action="{!timesheetDetails}" >  
                                <apex:outputText value="{0,date,MM/dd/yy}">
                                    <apex:param value="{!a.Date__c}" />                                         
                                </apex:outputText>
                                <apex:param value="{!a.Id}" name="getsk" assignTo="{!TimesheetDays}"/>
                            </apex:commandLink>
2
  • Try adding single quotes around the "/" characters in the format definition.
    – Phil W
    Mar 25, 2019 at 7:22
  • tried, no luck. <apex:outputText value="{0,date,MM'/'dd'/'yy}"> <apex:param value="{!a.Date__c}" /> </apex:outputText> Mar 25, 2019 at 8:43

1 Answer 1

3

You are using the value parameter in apex:commandlink so you're getting the date twice. If you remove it, it should work.

<apex:commandLink action="{!timesheetDetails}" >  
    <apex:outputText value="{0,date,MM/dd/yy}">
        <apex:param value="{!a.Date__c}" />                                         
    </apex:outputText>
    <apex:param value="{!a.Id}" name="getsk" assignTo="{!TimesheetDays}"/>
</apex:commandLink>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .