You need to sign in to do that
Don't have an account?

How to format date field value in visual force.
Hi all,
I have a problem with merging the date field into the visualforce page.
I used {!Oppr.Entry_Date__c} it displayed "Tue Aug 10 00:00:00 GMT 2010".
I require the format to be "Tue Aug 10 2010".
How to change the format to achieve my requirement.
Any help regarding this will be appreciated.
Thanks in Advance.
Use following in your VF page;
-Suresh
All Answers
Hi Uzair,
You can achieve this by writing controller. Just do the following.
Controller:
String eDate='';
public String getDate(){
eDate=Oppr.Entry_Date__c.format('EEE, MMMM d, yyyy');
return eDate;
}
and print in the VF page value="{!Date}".
Hello RajaApex,
Thanks for your reply.
I received the following error message
"Error: Compile Error: Method does not exist or incorrect signature: [Date].format(String) ".
any help to overcome this error wiil be appreciated.
Thanks in Advance.
you will need to typecast Date into Datetime datatype.
Sample code:
Use following in your VF page;
-Suresh
Thanks Prasanna it worked for me.
thanks suresh,
it just worked for me as i'd required.
Superb solution Suresh, thank you!