How can I display today's date in format like Monday December, 29th 2014 modifying this
<apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> <apex:param value="{!today()}" /> </apex:outputText>
this will display like 29/12/2014
Thank you
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityHow can I display today's date in format like Monday December, 29th 2014 modifying this
<apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> <apex:param value="{!today()}" /> </apex:outputText>
this will display like 29/12/2014
Thank you
You can use this:
<apex:outputText value="{0,date,EEEE MMMM',' d y}"> <apex:param value="{!today()}" /> </apex:outputText>
That will display something like: Monday December, 29 2014
The date formatting is based on simple date format. Note that to add "st","th","nd","rd" to the days additional coding is required, you may need an apex solution.
Try this
<apex:outputText value="{0,date,EEEE' 'MMMM', 'd' 'yyyy}">
<apex:param value="{!today()}" />
</apex:outputText>
It produces the following when I test in my dev org
Take a look at Java Simple Date Format for additional details and other possibilities
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
YYYY
to yyyy
. Now showing 2014 as it should.
Dec 29, 2014 at 11:24