Set the time zone
To ensure that the application server runtime and your J2EE application components have the correct date and time values, set the user.timezone property. The syntax of the property is
user.timezone=timezonewhere timezone is the supported value for your time zone. For a list of supported values, see Supported user.timezone property values for the Development Kit for Java(R) 1.3.
Note: The Java(TM) virtual machine calculates the time based on the value of the user.timezone property and the system values QHOUR and QUTCOFFSET. QUTCOFFSET represents the number of hours difference between the system's time zone and Greenwich Mean Time (GMT). The Java virtual machine adds the values of QHOUR and QUTCOFFSET to calculate GMT, then uses GMT and value of the user.timezone property to derive the correct time of the day.
Set the user.timezone property in several different files. The time zone setting has different effects based on the file in which it is specified.
Set the property to affect all Java virtual machine processes on your iSeries server.
Edit the user.timezone property in the /QIBM/UserData/Java400/SystemDefault.properties file. If the file does not exist, create it in this directory.Set the property to affect application servers.
You have two options:
- Edit the /home/user_ID/SystemDefault.properties file, where user_id is the user profile under which the application server runs. By default, this is the QEJBSVR user profile. If the file does not exist, create it in this directory. If you specify the time zone in this file, only application server jobs are affected.
- In the administrative console, add the user.timezone property to the Java virtual machine system properties for your application server:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server for which you want to set the time zone.
- On the application server page, click Process Definition.
- On the Process Definition page, click Java Virtual Machine.
- On the Java Virtual Machine page, click Custom Properties.
- On the Custom Properties page, click New.
- Specify user.timezone in the Name field and timezone in the Value field, where timezone is the supported value for your time zone.
- Click Apply.
- Save the configuration.
Configure a locale to specify the time zone
You can also configure your application server to run in a locale. The locale determines the time zone in which a Java virtual machine operates. To use locales, follow these steps:
- If Extended NLS Support is not already installed on your iSeries server, install it by selecting option 21 when you install the OS/400 base operating system (5769-SS1).
- Run the Create File (CRTF) command to create a locale source physical file from file LOCALSRC in library QSYSLOCALE.
- Run the Start SEU (STRSEU) command to edit the source file.
- Specify a time zone in the file.
Note: 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 time zone field TNAME. The value of TNAME must match the name of a Java time zone.
- Run the Create Locale (CRTLOCALE) command to create a locale from the source file.
- Run the Change User Profile (CHGUSRPRF) command to change the user profile under which the application server runs. Edit the user profile to use the new locale.
If you use more than one method to specify the time zone, the application server prioritizes the methods in this order:
- Java virtual machine system property
- User directory SystemDefault.properties file
- java400(TM) SystemDefault.properties file
- Locale