+ Start a Discussion
SoundarSoundar 

Date Format In Visualforce page

Hi Friends,

I need some accurate solution in date format, i think it's easy to salesforce developer . but i am new to salesforce .

I dispalyed  the date format like below 

 <apex:outputtext value="{0, date, medium}">
        <apex:param value="{!Inspection_Sheet__c.Date__c}"></apex:param>
    </apex:outputtext>

Output Is : Oct 21,2016

But I need a output like this --> 21st Oct 2016

Can Anyone help to me ASAP. 

I will be appreciate if you are come with the best solution .

Many Thanks In advance !!

Regards ,

SOUNDAR ,

+91-7418425418.
Best Answer chosen by Soundar
SoundarSoundar
HI Rowallim Technology,

you are correct !! but in small amendments 

<apex:outputText value="{0,date,dd' 'MMMMM' 'yyyy}">
    <apex:param value="{!Inspection_Sheet__c.Date__c}" /> 
</apex:outputText>

Thanks For Your Response....

All Answers

Rowallim TechnologyRowallim Technology
Hi Soundar
Here is the code you need for this date format.
<apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
    <apex:param value="{!Inspection_Sheet__c.Date__c}" /> 
</apex:outputText>
Hope this Will Help you.
Please mark It Best answer if it helps.
 
Thanks
SoundarSoundar
Hi Rowallim,

Really thanks to your awesome helping .

I tried Your Code , it's displaying like below.

21/10/2016  But I am expecting like 21st October 2016

Can you give an accurate solution please .


Many Thanks ..
Harish RamachandruniHarish Ramachandruni
HI,



Execute in developer counsole and check deburg below code .

 
DateTime d = datetime.now();
//String monthName= d.format('MMMMM');

String monthName= d.format('dd/MMMMM/yyyy');

System.debug(monthName);

This formate will get name of the month         format('dd/MMMMM/yyyy');


any issue ask me .


Regards ,

Harish.R.
 
SoundarSoundar
HI Rowallim Technology,

you are correct !! but in small amendments 

<apex:outputText value="{0,date,dd' 'MMMMM' 'yyyy}">
    <apex:param value="{!Inspection_Sheet__c.Date__c}" /> 
</apex:outputText>

Thanks For Your Response....
This was selected as the best answer
SoundarSoundar
Hi Harish rao 25 ,


Your coding is perfectly working fine , but i don't want to create class for this one . 

thanks for your quick response.
SaranrajSaranraj
Hi Soudar,
Above you given a perpect syntex for visualforce date formate
It working fine for me
Many thanks!
Dhanik L SahniDhanik L Sahni
Thsi is worked for me.
              <apex:outputText value="{0, date, dd/MM/yyyy}">
                 <apex:Param value="{!relatedTo.AE_Patient_DOB__c }" />
                </apex:OutputText>
 
unlockmytv apk 5unlockmytv apk 5
Thanks for the solution , i like it.
Raj (http://unlockmytv.xyz/)
Sam clicheSam cliche
Good one. Keep going.
How about watching movies online for free on Typhoon TV?