I recently ran into a situation that should be documented in a README FIRST file in WebSphere and installation of the basic Java Virtual Machine (JVM ? 5769JV1 for V4R5 or 5722JV1 for V5R1).
My machine is in Los Angeles and was set to Pacific Standard Time (PST). At 4:30pm we were running servlets that used methods from the Java DATE and CALENDAR classes to create documents, e-mail and update our database with the date and time that an event occurred. Our developers found that the date was displaying the next day for the date and 00:30 as the time.
Further investigation revealed that if we simply used the basic Date() method, the date and time would display in UTC (Universal Coordinated Time). We used our Support Line contract and opened a problem report. We were told to create a file named
SystemDefault.properties
This file can control global Java behavior for the system when it is placed in the following directory:
/QIBM/UserData/Java400/
It can affect a specific user's Java settings when placed in the user's root directory:
/home/userid/
Create SystemDefault.properties (case-sensitive) containing the following two lines:
java.version=1.3
timezone=PST
PST is the Java acronym for your time zone. It also accepts and supports the Java 1.3 method of defining time zones such as America/Los_Angeles. (See http://www.ignite400.org/html/wastimezones.htm for a list of time zones.)
This parameter assumes you have set the QTIME system value to your local time and provided an offset in the QUTCOFSET system value to adjust back to UTC. In Los Angeles, Pacfic Standard Time has an offset of -8 hours (-08:00). Once the time zone entry in SystemDefault.properties is established, Java will now adjust the methods on the Date and Calendar Classes to local time.
When daylight savings time (Summertime in the UK) arrives, you need to change the QTIME system value and QUTCOFSET from -08:00 (for Pacific time) to -9:00 to reflect the new offset. You do not need to change the timezone= parameter in SystemDefault.properites.
I've searched the IBM InfoCenter using its search engine and also searched it with Google. I found a few hits on the SystemDefault.properties file, but none on the time zone parameter.
Here are couple of other parameters you may be interested in finding more information about:
file.encoding=ISO8859_1 -- This affects code page equivalency within Java.
java.compiler=jitc -- This apparently enables the Just In Time compiler.
java.version=1.3 -- Supposedly Java 1.4 is on the horizon. This sets the default JVM to use.
I'm going to do more research on the SystemDefault.properties file and will share my findings in a future tip.
-------------------------
About the author: Bob Cancilla is managing director of IGNITe/400, an electronic iSeries 400 Internet users group. He is also author of the book Getting Down to e-business with AS/400.
=======================
MORE INFORMATION
=======================