Issues With Setting Time Zone Settings on the JVM Level

Liferay Support does not recommend or endorse specific third-party products over others. Liferay is not responsible for any instructions herein or referenced regarding these products. Any implementation of these principles is the responsibility of the subscriber. 

Modifying the time zone settings at the JVM level (setenv.bat or in tomcat) will affect all of the processes run in that JVM.

This article describes several known issues that may be experienced if the time zone is not set to GMT at the JVM level.


1. The Calendar Portlet May Not Function Correctly

When the time zone is NOT set to GMT at JVM level, the Start Date and End Date of the all day events exported from the Calendar portlet might display the incorrect date after the exported .ics files are imported to Microsoft Outlook. The root cause is that changing the time zone at the JVM level will cause the portal to wrongly calculate the Start Date and End Date of the all day events.

Also, another related issue can be found at LPS-33526.

2. Web Content Created Using Structures That Have the Date Fields Will Display Incorrect Dates After Publishing

​When the time zone is NOT set to GMT at JVM level, for example, it is configured to -Duser.timezone = Europe/Berlin, the web contents created using structures that have the Date fields will display incorrect dates after publishing.

  1. Configure the setenv appropriate for your environment so that the -Duser.timezone equals Europe/Berlin, like so:


  2. Start Liferay
  3. Go to Admin > Site Administration > Content > Web Content
  4. Add a new structure that includes a Date field and assign it to a template
  5. ​Create a new article with the structure and template created in step 4, choosing a date for the Date field

After publication, see that the date is set to the day BEFORE the one set in step 5.

In summary, each date stored in the portal's database is (must be) stored in GMT time. When the portal needs to display one stored date to the end users, the portal then calculates the display date based on the current date of the application server (this date is affected by the configured JVM level time zone) and the stored GMT format date. In order to make sure the display date is calculated correctly, the time zone must be configured to GMT at the JVM level. Otherwise, it will result in incorrect time zone offset and then cause the display date to be wrongly calculated and displayed.

3. User login fails after changing credentials on LDAP with DXP 7.0 > FP 81

Was this article helpful?
0 out of 0 found this helpful