How to remove time from date in Visualforce page?


Sample Code:

Visualforce page:

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


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()
    {
    }
}


Output:


3 comments:

  1. Hi, i'm try these post.. but i'm getting the fallowing error.. i'm new to salesforce

    Error: Sample Compile Error: Invalid type: Member__c

    ReplyDelete
    Replies
    1. Because you are not created Member custom object...First of all you create the member object then try....

      Delete
    2. First u create an object as Member after u will try

      Delete