(iseries)

Set the same time zone for all of the JVM processes

We can set the same time zone for all of the JVM processes running on the IBM i server.

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

In some application environments, it is important that all of the JVM processes use the same time zone. If this is the situation, before starting the application servers, we can either update the user.timezone property in the SystemDefault.properties file for the IBM i server or configure a locale for that server:

  1. Update the user.timezone property in the SystemDefault.properties file for the IBM i server

    Important: The value specified for the user.timezone property overrides any system locale setting you create.

    1. Edit the SystemDefault.properties file located in the /QIBM/UserData/Java400 directory. If the file does not exist, create a SystemDefault.properties file in that directory.

    2. Change the value specified for the user.timezone property to the correct time zone. If this property does not exist, add it to the file.

      The syntax for setting the property is user.timezone=timezone, where timezone is the supported value for the appropriate time zone.

      The JVM calculates the time based on the value of the user.timezone property and the QHOUR and QUTCOFFSET system values. QUTCOFFSET represents the number of hours' difference between the system's time zone and Greenwich Mean Time (GMT). The JVM adds the values of QHOUR and QUTCOFFSET to calculate GMT, and then uses GMT and value of the user.timezone property to derive the correct time.

    3. Save the change.

  2. Configure a system locale for the IBM i server.

    Avoid trouble: If a value is specified for the user.timezone property in the SystemDefault.properties file, it overrides this system locale setting.gotcha

    1. Create a locale source file.

      Run the Create File (CRTF) command to create this file from the LOCALSRC file in the QSYSLOCALE library.

    2. Edit the source file by running the Start SEU (STRSEU) command.

    3. Specify a time zone in the file.

      The source file also contains settings to indicate when daylight savings time begins, when it ends, and how much time to add or subtract. The JVM ignores these settings and reads only the TNAME time zone field. The value of TNAME must match the name of a Java time zone value.

    4. Create the locale by running the Create Locale (CRTLOCALE) command.

    5. Edit the user profile to use the new locale.

      To change the user profile under which the application server runs, run the Change User Profile (CHGUSRPRF) command.

    6. Save the changes.


Results

All of the JVM processes running on the IBM i server use the same time zone.


What to do next

Start the application servers.


Related tasks

  • Set the time zone for all of the application servers running under a user profile

  • Time zone IDs that can be specified for the user.timezone property