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

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>

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 ,


Best Answer chosen by Soundar
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}" /> 

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}" /> 
Hope this Will Help you.
Please mark It Best answer if it helps.
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

Execute in developer counsole and check deburg below code .

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

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


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

any issue ask me .

Regards ,

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}" /> 

Thanks For Your Response....
This was selected as the best answer
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.
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 }" />
rohit kumar 565rohit kumar 565
Click here for Punjab ration card list 2020  (" target="_parent)
Reddy RakeshReddy Rakesh

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 to pay medical bills online. Paying bills with the help of we save money and time both and don’t pay any additional charge. Platforms like these have known to make our lives much easier.
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.
Exammedia Sarkari portal, students can download admit card, check result, latest job notifications, latest Sarkari result (, Sarkari job, latest job, Sarkari employment,  admit card, latest job Notifications Click Here. (
Global PointGlobal Point
We share different types of information (
Antony GhoshAntony Ghosh
Click Here For PM Awas Yojana Latest Update (Gramin&Urban)
Click Here For view details of All Railway Jobs ,Posts,Salary
ipo bazaripo bazar
Upcoming IPO GMP, Subscripion, Allotment, Listing, You can Vistit (
Check Latest GMP You Can Visit IPO GMP Grey Market Premium  (
Check IPO Subscription Live ( Details Go Now
Check IPO Allotment Status ( On IPO Bazar Now,
Salesforce information (
Features of Salesforce (
Trading BuzzrTrading Buzzr
Get Upcoming IPO GMP, Subscripion, Allotment, Listing details at 
Check Latest SME IPO ( Details
Check Delivery IPO ( complete details at TradingBuzzr!