Setting Custom Timezones in Liferay

By default Liferay uses UTC as timezone. In order to set custom timezones you may choose from the following options:

  1. Create an EXT-Plugin
  2. Specify timezone in Tomcat’s setenv script

EXT-Plugin

Create an EXT-plugin (or use your existing one) and put system-ext.properties in extyour-extdocrootWEB-INFext-implsrc using the following setting:

user.timezone=Europe/Vienna

Be sure the deploy and restart Tomcat afterwards. Also, check via the Control Panel in Server Administration / System properies that the timezone attribute has been applied correctly.

Setenv Script

The other option is to set your desired timezone in Tomcat’s setenv script located in tomcat/bin by using the following command:

-Duser.timezone=Europe/Vienna

Depending on your operating system you will need to configure setenv.bat (Windows) or setenv.sh.

Liferay Developer Studio

If you happen to use Liferay Developer Studio you can easily set your desired timezone using the server properties, as shown below:

You may also like...

1 Response

  1. Hemraj says:

    hi ,
    I am setting these properties in the setenv.sh.
    but still its showing UTC time.
    And I am doing this for LR 7.0
    Thanks in advance
    Regards,
    Hemraj

Leave a Reply

Your email address will not be published. Required fields are marked *

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