function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
renuamirenuami 

retrieve date value

Hello

 

can someone help me how to display only the date value

 

 expiration_date__c field is defined as datetime. so it is displaying the value as Sun May 31 19:00:00 GMT 2009.

 

But i want to display the  expiration_date__c value as 5/31/2009

 

 

 

<apex:page controller="Travelling_Home" action="{!init}"> <apex:form > Your expiration date is {!tvtresults.expiration_date__c} </apex:form> </apex:page>

 

 

public class Travelling_Home { Travelling__c tvt; public Travelling__c gettvtresults() { return tvt; } public PageReference init() { if(tvt==null) tvt=[select place__c,expiration_date__c from Travelling__c__c where expiration_date__c>=TODAY and USER_ID__c=:UserInfo.getUserId() limit 1]; return null;

} }

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Sam.arjSam.arj

The only way is to use the following:

 

 

{!DAY(tvtresults.expiration_date__c)}/{!MONTH(tvtresults.expiration_date__c))}/{!YEAR(tvtresults.expiration_date__c)}

 

 

 

All Answers

Sam.arjSam.arj

The only way is to use the following:

 

 

{!DAY(tvtresults.expiration_date__c)}/{!MONTH(tvtresults.expiration_date__c))}/{!YEAR(tvtresults.expiration_date__c)}

 

 

 

This was selected as the best answer
renuamirenuami

Sam...Thank you very much....It help me a lot..

 

Thanks

again