Changing time zone settings

In some application environments, it is important that application server components use the same time zone. You can use the administrative console or system environment variables to ensure that your application components use the correct time zone.

Before you begin

[IBM i]Note: If you plan to change the system clock, stop the application server first. After you stop the server, change the system clock, and then restart the server. If you change the system clock on one system, you must ensure the clocks on all systems that communicate with each other, and have the product installed, are synchronized. Otherwise, you might experience errors, such as security tokens no longer being valid.

[IBM i]Verify that extended National Language Support (NLS) is installed on your i5/OS server. If extended NLS support is not already installed, install it by selecting option 21 when you install the base operating system (5769-SS1).

Determine the scope at which you want to set the time zone value. You can set the time zone value such that is applies for an entire cell, for an entire node, or only for a specific server.

Remember that time zone IDs should include an offset and, in almost all cases, a daylight saving time zone name for consistent results. For example, specify EST5EDT for Eastern Standard Time, Daylight Savings Time.

About this task

In general cases, the time zone for application server is inherited from the time zone that is set for the operating system; Java™ should be inherit the time zone from the operating system, and the application server will use the time zone that is set for each Java Virtual Machine (JVM). If you need to configure a different time zone for a single JVM, you can set the TZ environment variable in the application server, modify the properties file, or specify a command-line parameter when the JVM starts.

[IBM i]You can change the time zone setting for your application logs for all of the processes running in a single application server, for all of the application servers running under a user profile, or for all of the JVM processes running on the WebSphere® Application Server subsystem.

Procedure

  • Set the time zone for each of your server processes.
    1. In the administrative console, click Servers > Server Types > WebSphere application servers > server_name > Java process management > Process definition > Environment entries.
    2. Set a value for the TZ variable.
      • If the TZ variable is included in the list of defined variables, click TZ, and then specify a new time zone value in the Value field.
      • If the TZ variable is not included in the list of defined variables, click New, and then specify TZ in the Name field, and the appropriate time zone value in the Value field.
      For example, if you specify TZ in the Name field, and EST5EDT in the Value field, Eastern United States is used as the time zone setting for all of your server processes.
    3. Click Apply, and then click Save to save your changes.
    4. Stop and restart all of the affected application server that were running when you made the time zone changes.
  • [IBM i] Update the user.timezone property with the appropriate time zone setting in the properties file.
    • To change the time zone setting for all application servers under one user profile, update the user.timezone property in the user profile properties file with the appropriate time zone setting.
    • To change the time zone setting for a WebSphere Application Server subsystem, update the user.timezone property in the properties file, or set a system local variable for that subsystem.
  • Set the time zone with a command-line property for each JVM.
    For example, use the following parameter to set the time zone on the Java call:
    -Duser.timezone=time_zone_code

Results

Your new time zone setting applies for the designated servers.