如何在Liferay Portal 5.2+中更改默认时区 [英] How can I change default timezone in Liferay Portal 5.2+
问题描述
根据时区和时间偏移,使用Liferay Portal Community 5.2.3时遇到问题.在Windows中,它似乎可以正常工作(GMT + 2 Madrid选择了自动),但是当我在Linux服务器上安装时,时区卡在了UTC(GMT)上.
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).
我没有system-ext.properties,因此默认值为UTC,但是...在Windows上它如何工作?
I've no system-ext.properties, so default is UTC, but then... how it works on Windows?
在管理->系统属性中,两个安装都获得时区的UTC
In administration->system properties I get UTC for timezone on both installations
我在做什么错了?
还有另一个问题.如果我将时区设置为GMT + 2(CEST),那么取消"夏令时(CET)会发生什么??我必须将时区指定为"Europe/Madrid"还是"GMT + 2"吗?它会自动更改吗?
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?
提前谢谢!
TomásGarcía
Tomás García
推荐答案
启动Liferay时,需要将其作为系统属性传递.
You need to pass that as a system property when starting Liferay.
假设您正在使用Tomcat捆绑软件,请在Windows上检出文件bin\setenv.bat
或在Linux上检出bin/setenv.sh
文件.
Assuming you are using the Tomcat bundle, check out the file bin\setenv.bat
on Windows or bin/setenv.sh
on Linux.
Liferay默认软件包包含参数
The Liferay default package contains the parameter
-Duser.timezone=GMT
设置的JAVA_OPTS行中的
.
in the set JAVA_OPTS line.
只需将其更改为您的时区,例如
Just change that to the your timezone, e.g.
-Duser.timezone=Europe/Madrid
如果我没有记错的话,欧洲/马德里将正确处理DST.
Europe/Madrid will correctly deal with DST if I'm not mistaken.
这篇关于如何在Liferay Portal 5.2+中更改默认时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!