Setting the time zone for a JVM server
The TZ environment variable specifies the local
time of a
system. You can set this for a JVM server by adding it to the JVM profile. If you do not set the TZ
variable, the system defaults to UTC. Once the TZ variable is set, a JVM automatically transitions
to and from daylight savings time as required, without a restart or further
intervention.
When setting the time zone for a JVM server or Node.js application, you should be aware of the
following issues:
- The TZ variable in your JVM or Node.js profile should match your local MVS system offset from GMT. For more information on how to display and set your local MVS system offset, see TIMEZONE statement in z/OS Communications Server: IP Configuration Reference and Adjusting local time in a sysplex in z/OS MVS Setting Up a Sysplex.
- Customized time zones are not supported and will result in failover to UTC or a mixed time zone output in the JVMTRACE file (for JVM servers) or TRACE file (for Node.js applications).
- If you see LOCALTIME as the time zone string, there is an inconsistency in your configuration. This can be between your local MVS time and the TZ you are setting, or between your local MVS time and your default setting in the JVM or Node.js profile. The output will be in mixed time zones although each entry will be correct.
Using the POSIX time zone format
The POSIX time zone format has a short form and a long form. You can use either to set the TZ environment variable, but using the short form reduces the chance of input errors.Long form examples with daylight saving (Greenwich Mean Time, Central European Time, Eastern
Standard Time):
TZ=GMT0BST,M3.5.0,M10.4.0
TZ=CET-1CEST,M3.5.0,M10.5.0
TZ=EST5EDT,M3.2.0,M11.1.0Short form examples with daylight saving (Greenwich Mean Time, Central European Time, Eastern
Standard Time):
TZ=GMT0BST
TZ=CET-1CEST
TZ=EST5EDTExamples with no daylight saving (Malaysian Time, China Standard Time, Singapore
Time):
TZ=MYT-8
TZ=CST-8
TZ=SGT-8To find out what time zone your system is running on, log on to USS and enter
echo $TZ. The result is the long form of the value your TZ environment variable
should be set to./u/user:>echo $TZ
GMT0BST,M3.5.0,M10.4.0For a more detailed breakdown of the POSIX time zone format, see POSIX and Olson time zone formats on the IBM® developerWorks® site.