You need to sign in to do that
Don't have an account?
danlat
Output day 'th', 'st', 'nd', 'rd' text
Hi All,
Does anyone know how to output the day text part? ie for 1st, it would be 'st', 2nd 'nd', etc. It doesnt seem possible with Java date formatting: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
Thanks in advance.
Create your own - it seems like simple if-else logic... but before you do that google it - you may find solution outside java world which should be quite easy to transform into java.
All Answers
Create your own - it seems like simple if-else logic... but before you do that google it - you may find solution outside java world which should be quite easy to transform into java.
Hi,
Thanks for the reply.
I only mention Java because APEX uses the same date format patterns as Java. At the moment I have this:
<apex:outputText value="Dated: {0,date,d MMMMM yyyy}"> <apex:param value="{!NOW()}" /> </apex:outputText>
Which prints somthing like "8 July 2010", I was just wondering how to get "8th July 2010" ('th' should be superscript)
But your right, a simple IF would do.
Thanks
There shouldn't be a MOD on the first line as it would turn 11 into 1, 12 into 2, etc.: