简体   繁体   中英

How can I change default timezone in Liferay Portal 5.2+

I'm having an issue using Liferay Portal Community 5.2.3 according to timezones and time offsets. In windows, it seems to work correctly (GMT+2 Madrid picked auto), but when I install in Linux server, timezone gets stuck to UTC (GMT).

I've no system-ext.properties, so default is UTC, but then... how it works on Windows?

In administration->system properties I get UTC for timezone on both installations

What am I doing wrong?

And another question. If i set timezone to GMT+2 (CEST), what happens when daylight saving is "removed" (CET)?¿ Do I have to specify timezone as "Europe/Madrid" or as "GMT+2"? Does it change automatically?

Thanks in advance!

Tomás García

You need to pass that as a system property when starting Liferay.

Assuming you are using the Tomcat bundle, check out the file bin\\setenv.bat on Windows or bin/setenv.sh on Linux.

The Liferay default package contains the parameter

-Duser.timezone=GMT

in the set JAVA_OPTS line.

Just change that to the your timezone, eg

-Duser.timezone=Europe/Madrid

Europe/Madrid will correctly deal with DST if I'm not mistaken.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM