TZ and TZTAB Information

»  Home

» Software
» Papers & Training
» Java

The MPE/iX POSIX Shell and commands are part of a package developed by a 3rd party whose software runs on many other systems including the HPe3000. The proprietary library of time functions it uses to translate UTC to local time do not use HP's TZTAB. However, the MPE/iX POSIX Shell and commands do use the TZ variable when converting UTC to local time and adjusting for daylight saving time. Therefore, in order for the MPE/iX POSIX shell to recognize new daylight saving time rules, the TZ variable must be explicitly set as shown below.

The MPE/iX POSIX Shell uses the POSIX 1003.1 TZ format, a description of this format can be found in the MPE/iX Shell and Utilities Reference Manual. The format is also described in Chapter 8 of the IEEE Std 1003.1, 2004 Edition from Opengroup.org.

The extended format of the POSIX 1003.1 TZ variable is:

standardHH[:MM[:SS]][daylight[offset][,startdate[starttime],enddate[endtime]]]

For example: PST8PDT7,M3.2.0/2:00,M11.1.0/2:00

This is also an example of the definition for the U.S. 2007 rules which say that DST begins in the 3rd month or March (M3), in the 2nd week (.2) on Sunday (.0) at 2:00am and ends on in the 11th month or November (M11), in the 1st week (.1) on Sunday (.0) at 2:00am.

Here are the POSIX 1003.1 extended TZ definitions for the 4 U.S. timezones:

Time Zone Traditional TZ Variable Extended POSIX 1003.1 TZ Variable
Eastern EST5EDT EST5EDT4,M3.2.0/2:00,M11.1.0/2:00
Central CST6CDT CST6CDT5,M3.2.0/2:00,M11.1.0/2:00
Mountain MST7MDT MST7MDT6,M3.2.0/2:00,M11.1.0/2:00
Pacific PST8PDT PST8PDT7,M3.2.0/2:00,M11.1.0/2:00

Using the extended POSIX 1003.1 TZ variable definition will enable the MPE/iX POSIX Shell and commands to correctly translate UTC to local time.


PLEASE NOTE: The library routines used by the MPE/iX POSIX Shell and commands are hard coded to understand the pre-2007 Daylight Saving Time rules. Using the abbreviated TZ variable format, for example PST8PDT, invokes the Shell's internal algorithm and will not reflect new daylight saving rules. This short TZ format will result in adjusting Pacific daylight saving via the old rule of 3:00am local time on 1 April 2007.
ALSO NOTE: Using the extended POSIX 1003.1 form of TZ will not affect your programs that use C library time and date functions. In fact, the MPE/iX C Library will also recognize this longer format TZ and if used it will NOT need to search TZTAB for the proper DST definition.

Summary

  • The extended POSIX 1003.1 format of the TZ variable must be used to enable the MPE/iX Shell and commands to translate UTC to local time
  • Either the short (traditional) form of the TZ variable or the extended POSIX 1003.1 format may be used to allow programs linked with the C library to translate UTC to local time.
  • Using the extended POSIX 1003.1 TZ format allows programs linked with the C library to avoid opening and searching the TZTAB file.
  • Both formats of TZ variable work within the MPE/iX POSIX Shell and the MPE/iX command interpreter. For example:
  • :SETVAR TZ "CST6CDT5,M3.2.0/2:00,M11.1.0/2:00"
    Shell/iX> export TZ=CST6CDT5,M3.2.0/2:00,M11.1.0/2:00

Top    JazzInfo    Hosted by 3kRanger.com    email 3kRanger    Updated