How can I go about displaying a date that is formatted to a users locale, for example me and my Australian friends use the format dd/MM/yyyy, while the Americans amoung us use MM/dd/yyyy. I know I can format a date in visualforce like so
<apex:outputText value="{0,date,dd/MM/yyyy}">
<apex:param value="{!myDateValue}" />
</apex:outputText>
but how can I use the salesforce locale, There is a complete list but how can I use these on my page?
I have found a very comprehensive solution here, but I was hoping someone new of an inbuilt, or more elegant way.
Best Answer
The easiest way to do this might be to utilise the 'named' date formats that are available, for example, short and long:
BUG ALERT
While official documentation hints that message formats respect locale, currently the named messages formats (short, medium, and long) always output in US date format (month then day) or possibly the locale of your instance. A support request was logged and R&D replies that this won't work and will never work