Introduction
Liferay supports localization by language, time zone, and more. While Liferay has a default configuration for time zones, you can set the platform to use any standard time.
After installing Liferay and creating all users, a company noticed that the instance and all users are configured with the default time zone (UTC). However, they should be updated to the correct one: Europe/Paris.
In this article, you'll perform a bulk update of the time zone of all existing users in your instance.
Environment
- DXP 7.0, 7.1, and 7.2
- Portal 6
Steps
- Pick a valid time zone ID from the
time.zonesproperty in this portal.properties file. For example,Europe/Paris. - Stop all Liferay server nodes.
- Perfome a backup of your database and Liferay environment before doing any change.
- Execute the following SQL updates (replace
Europe/Pariswith your own time zone):update User_ set timeZoneId = 'Europe/Paris' update Calendar set timeZoneId = 'Europe/Paris'
- Start all Liferay server nodes.
Important Notes:
- Changing the instance's default time zone from the configuration menu doesn't update the time zone of the existing users.
- To avoid major issues, contact Liferay's Support team for assistance and further guidance before executing SQL updates directly to the database.
- Always configure time zones at the instance or user levels. The JVM's default time zone (UTC) should not be changed to avoid job scheduling issues and incorrect behavior. See the Things Liferay Won't Say blog post for more information.