Setting the TZ environment variable


GoServe currently computes GMT from the local time-of-day clock (set by the TIME and DATE commands) and the setting of the TZ environment variable. The simple form of the value of TZ (which is suitable for use in the USA or other countries that change to and from daylight savings time at the same time as the USA) is as shown in:

  SET TZ=EST5EDT

where EST is the standard time zone name (this must be exactly three characters), EDT is the daylight savings time zone name (also exactly three characters), and 5 is the difference between the standard time zone and GMT, measured in hours West of GMT.

Note that the sign of the GMT offset used in the TZ variable is opposite to that used for calculating the local time, given GMT, as returned by the GoServe GMTOFFSET() function.

The simple form of TZ setting assumes that a 1 hour daylight savings change starts at 01:00 on the first Sunday in April, and ends at 02:00 on the last Sunday of October.

For other countries, the full form of the TZ value has to be used. More formally, this is:

  SET TZ=SSS[+|-]nDDD,sm,sw,sd,st,em,ew,ed,et,shift

Where 'SSS', 'n', and 'DDD' are the values as in the simple form. In the long form, all the other values must be specified, as follows.

'sm', 'sw', 'sd', and 'st' define the start time for daylight savings adjustment, where:

'em', 'ew', 'ed', and 'et' define the end time for daylight savings, and take the same values.

'shift' is the shift in daylight time change, in seconds (e.g., 3600 if one hour is to be added during daylight savings time).

For example, for the UK in 1995, the setting is expected to be:

  SET TZ=GMT0BST,3,0,26,3600,10,0,22,3600,3600

Note that there appears to be no provision for time zone names of more than three characters (blanks are allowed, so fewer that three characters are OK). There also seems to be no provision for time zone offsets that are not an integer number of hours.

[]


[ previous section | GoServe]

From 'goserve.doc', version 2.32.
Copyright © International Business Machines Corporation, 1993, 1995.
All rights reserved.