Managing Timezone Settings
Managing Timezone Data
TimeZone Change Add-On
1Check the current timezone
Connect to the target container and run:
date

2Import the add-on
Copy the TimeZone Change manifest.jps link from the JPS Collection and import it through the dashboard.

Depending on the hosting provider, the add-on may also be available directly in Marketplace.

3Select the timezone
Choose the target environment, enter the required timezone name, and click Install.

4Verify the change
Run date again after installation.

Update Java Timezone Data
Java compute nodes include a TZdata package. Older containers may require a manual update when timezone rules change.
1Connect through Web SSH

Check the installed TZdata version:
java -jar /usr/java/utils/tzupdater.jar -V

Update the timezone package when necessary:
java -jar /usr/java/utils/tzupdater.jar -u

Change Java Timezone
To display the current server time on Tomcat, replace /opt/tomcat/webapps/ROOT/index.jsp with:
<%@page import="java.util.*"%>
<html>
<head>
<title>TZ Page</title>
</head>
<body>
<%=new Date(System.currentTimeMillis()).toString()%>
</body>
</html>


For Tomcat, TomEE, Payara, Spring Boot, and Jetty, add the following JVM option to the relevant variables.conf file:
-Duser.timezone=US/Pacific
| Application Server | Configuration File |
|---|---|
| Tomcat 7, 8, 9 and TomEE | /opt/tomcat/conf/variables.conf |
| Jetty 9 | /opt/jetty/etc/variables.conf |
| Payara 4 and 5 | /opt/payara/glassfish/domains/domain1/config/variables.conf |
| Spring Boot 1 and 2 | /opt/shared/conf/variables.conf |

For GlassFish, open the administration panel and add the same JVM option under Configurations > gfcluster-config or server-config > JVM Settings > JVM Options.

For WildFly, edit /opt/wildfly/bin/standalone.conf, or /opt/wildfly/bin/domain.conf for a horizontally scaled server:
export JAVA_OPTS="-Duser.timezone=US/Pacific"

Save the changes and restart the application server.

Check PHP Timezone Data
PHP timezone settings are managed in the [date] section of php.ini.

When the internal timezone database is outdated, enable the external Olson database by removing the leading semicolon from the timezone extension line, then save and restart the PHP server.

Open phpinfo() and review its date section to confirm the active timezone database.

Change PHP Timezone
To display the current PHP server time, replace /var/www/webroot/ROOT/index.php with:
<?php
echo date("h:i:sa");
?>


Set the required timezone in php.ini, for example:
date.timezone = Australia/Sydney

Save the configuration, restart the PHP node, and refresh the test page.

