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
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>
 
rohit kumar 565rohit kumar 565
Click here for Punjab ration card list 2020  (https://hindi.nvshq.org/punjab-ration-card-list/" target="_parent)
Reddy RakeshReddy Rakesh
HI,

try below code, it will disply like 28th February 2021

 <apex:outputText rendered="{!if((DAY(TODAY()) == 1) || (DAY(TODAY()) == 21) || (DAY(TODAY()) == 31) , true,false) }"> {!DAY(TODAY())}<sup>st</sup></apex:outputText>
                        <apex:outputText rendered="{!if((DAY(TODAY()) == 2) || (DAY(TODAY()) == 22) , true,false) }"> {!DAY(TODAY())}<sup>nd</sup></apex:outputText>
                        <apex:outputText rendered="{!if((DAY(TODAY()) == 3) || (DAY(TODAY()) == 23) , true,false) }"> {!DAY(TODAY())}<sup>rd</sup></apex:outputText>
                        <apex:outputText rendered="{!if((DAY(TODAY()) > 3 && DAY(TODAY()) <21) || (DAY(TODAY()) > 23 && DAY(TODAY()) <31), true,false) }"> {!DAY(TODAY())}<sup>th</sup></apex:outputText> 
                       &nbsp;<apex:outputText value="{0,date,MMMMM}"> <apex:param value="{!TODAY()}" /></apex:outputText> {!YEAR(TODAY())}:</strong> 
eliz rokeliz rok
Peryourhealth is a medical billing portal. It provides patients with secure access to their account. You can use peryourhealth.com to pay medical bills online. Paying bills with the help of peryourhealth.com we save money and time both and don’t pay any additional charge. Platforms like these have known to make our lives much easier. https://peryourhealth.fun
hen dizhen diz
The Taco Bell customer satisfaction survey collects customers’ feedback on their most recent visit to the restaurant. The tellthebell survey invites you to the world’s most popular feedback survey, which aims to improve the quality of Taco Bell Restaurant and the experience of its customers.  https://tellthebell.pro
EXAM EduEXAM Edu
Exammedia Sarkari portal, students can download admit card, check result, latest job notifications, latest Sarkari result (http://exammedia.in), Sarkari job, latest job, Sarkari employment,  admit card, latest job Notifications Click Here. (https://exammedia.in)
Global PointGlobal Point
We share different types of information (https://globalpoint.in/).
Antony GhoshAntony Ghosh
Click Here For PM Awas Yojana Latest Update (Gramin&Urban)
(https://careerhub.org.in/pradhan-mantri-awas-yojana-pmay/)
Click Here For view details of All Railway Jobs ,Posts,Salary
(https://fact-india.org/index.php/2021/10/30/railway-jobs-salary-and-posts/)
ipo bazaripo bazar
Upcoming IPO GMP, Subscripion, Allotment, Listing, You can Vistit Ipobazar.in (https://ipobazar.in/)
Check Latest GMP You Can Visit IPO GMP Grey Market Premium  (https://ipobazar.in/grey-market-premium/)
Check IPO Subscription Live (https://ipobazar.in/ipo-subscription/) Details Go Now
Check IPO Allotment Status (https://ipobazar.in/ipo-allotment-status/) On IPO Bazar Now,
AMAN KUMAR 292AMAN KUMAR 292
Salesforce information (https://www.rojgardunia.com/salesforce/)
AMAN KUMAR 292AMAN KUMAR 292
Features of Salesforce (https://www.rojgardunia.com/salesforce/)
Trading BuzzrTrading Buzzr
Get Upcoming IPO GMP, Subscripion, Allotment, Listing details at tradingbuzzr.com 
Check Latest SME IPO (https://tradingbuzzr.com/sme-ipos/) Details
Check Delivery IPO (https://tradingbuzzr.com/delhivery-ipo/) complete details at TradingBuzzr!