Print this page

How to change the display format of a date field on a visualforce page

Knowledge Article Number 000003084
Description

The format of date and date time fields is controlled by the locale setting of the profile of the user that displays them. 

Sometimes it is appropriate to change this or to allow the user to select a different language format (i.e. DD/MM/YYYY, which is the European format as opposed to MM/DD/YYYY which is the format used in the US)

This format can be changed by using the "language" attribute on the apex:page tag 

Resolution

In order to change the language of a page the language attribute must be set appropriately in the <apex:page> tag.

It must use the correct language code for example if Italian was the language that was desired the correct attribute to use would be 

<apex:page language="it-IT"> 

for Spanish it would be

<apex:page language="es-ES">

and so on for all the other supported languages.





promote demote