How to remove time from date in Visualforce page?

Sample Code:

Visualforce page:

  1. <apex:page controller="Sample" >  
  2.   
  3.     <apex:form >          
  4.   
  5.          <apex:outputText value="{0,date,dd'/'MM'/'yyyy}" >  
  6.              <apex:param value="{!temp}"/>  
  7.          </apex:outputText>  
  8.   
  9.     </apex:form>  
  10.   
  11. </apex:page>   

Apex Controller:

  1. public with Sharing class Sample {     
  2.   
  3.     public Date gettemp() {  
  4.         Date d = date.ValueOf('2013-12-10');  
  5.         return d;  
  6.     }  
  7.   
  8.     public List<Member__c> mem {get;set;}     
  9.         
  10.     public sample() {}  
  11.    
  12. }  

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