How to set date format for apex:outputText?

Sample Code:

Visualforce page:

<apex:page controller="Sample" >
    <apex:form >        
         <apex:outputText value="{0,date,dd'/'MM'/'yyyy}" >
             <apex:param value="{!temp}"/>

Apex Controller:

public with Sharing class Sample
    public Date gettemp()
        Date d = date.ValueOf('2013-12-10');
        return d;
    public List<Member__c> mem {get;set;}   
    public sample()


Note: Make sure 'MM' is alone in capital letters.


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit