You can set the same time zone for all of the JVM processes running
on your IBM® i
server.
Before you begin
Verify that extended National Language Support (NLS) is installed
on your 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).
About this task
In some application environments, it is important that all of your
JVM processes use the same time zone. If this is your situation, before starting
your application servers, you can either update the user.timezone property
in the SystemDefault.properties file for your IBM i server
or configure a locale for that server:
Procedure
- Update the user.timezone property in the SystemDefault.properties file
for your IBM i server
Important: The value you specify
for the user.timezone property overrides any system locale setting you create.
- 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.
- 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 Java™ virtual machine (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.
- Save your change.
- Configure a system locale for your 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
- Create a locale source file.
Run the Create File
(CRTF) command to create this file from the LOCALSRC file in the QSYSLOCALE
library.
- Edit the source file by running the Start SEU (STRSEU) command.
- 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 Java virtual machine 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.
- Create the locale by running the Create Locale (CRTLOCALE) command.
- 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.
- Save your changes.
Results
All of the JVM processes running on your IBM i server use the same
time zone.
What to do next
Start your application servers.