Time Zones with f:convertDateTime in JSF

Although it is not mentioned in the spec, the default time zone for f:convertDateTime in 1.2 is GMT, as you can see here.

To convert times for São Paulo, for example, you need to write:

<f:convertDateTime type="time" timeStyle="medium" timeZone="America/Sao_Paulo" />


In 2.0+, you can set it to TimeZone.getDefault() instead in the web.xml file:


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.