Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 30
Interacting With the DST Transition Table
Using the ADDDSTTRANSITION Procedure
You supply the ADDDSTTRANSITION procedure with two Julian timestamps and an
offset. The timestamps specify the beginning and the end of a time period. The
offset specifies the number of seconds that the LCT offsets the LST for the specified
period. The following example sets three transitions.
Note that successive calls to ADDDSTTRANSITION must load the DST table in time
sequence with no gaps. Every call to ADDDSTTRANSITION except the first call must
have the low-gmt parameter equal to the high-gmt parameter of the previous call.
These restrictions do not apply on G05.00 and later G-series release systems.
!First DST period; April 14, 1991 through October 20, 1991:
DATE^AND^TIME[0] := 1991; !year
DATE^AND^TIME[1] := 4; !month
DATE^AND^TIME[2] := 14; !day
DATE^AND^TIME[3] := 2; !hour
DATE^AND^TIME[4] := 0; !minute
DATE^AND^TIME[5] := 0; !second
DATE^AND^TIME[6] := 0; !millisecond
DATE^AND^TIME[7] := 0; !microsecond
LOW^GMT := COMPUTETIMESTAMP(DATE^AND^TIME,
ERROR^MASK);
IF ERROR^MASK <> 0 THEN CALL INVALID^DATE;
DATE^AND^TIME[0] := 1991; !year
DATE^AND^TIME[1] := 10; !month
DATE^AND^TIME[2] := 20; !day
DATE^AND^TIME[3] := 2; !hour
DATE^AND^TIME[4] := 0; !minute
DATE^AND^TIME[5] := 0; !second
DATE^AND^TIME[6] := 0; !millisecond
DATE^AND^TIME[7] := 0; !microsecond
HIGH^GMT := COMPUTETIMESTAMP(DATE^AND^TIME,
ERROR^MASK);
IF ERROR^MASK <> 0 THEN CALL INVALID^DATE;
OFFSET := SECONDS^IN^HOUR;
CALL ADDDSTTRANSITION(LOW^GMT,HIGH^GMT,OFFSET);
!Second DST period; October 20, 1991 through April 12, 1992:
LOW^GMT := HIGH^GMT;
DATE^AND^TIME[0] := 1992; !year
DATE^AND^TIME[1] := 4; !month
DATE^AND^TIME[2] := 12; !day
DATE^AND^TIME[3] := 2; !hour
DATE^AND^TIME[4] := 0; !minute
DATE^AND^TIME[5] := 0; !second
DATE^AND^TIME[6] := 0; !millisecond
DATE^AND^TIME[7] := 0; !microsecond
HIGH^GMT := COMPUTETIMESTAMP(DATE^AND^TIME,