Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 35
Interacting With the DST Transition Table
Using the DST_TRANSITION_MODIFY_ Procedure
You supply the DST_TRANSITION_MODIFY_ procedure with pointers to two
zsys_ddl_dst_entry_def structures with their fields filled in. The first of these structures
describes an existing entry in the DST table that has to be modified. The second
structure describes a new entry that will replace the entry that needs to be modified.
The following rules have to be kept in mind while modifying entries from the DST table:
#include <zsysc>
#include <cextdecs(COMPUTETIMESTAMP,DST_TRANSITION_MODIFY_)>
zsys_ddl_dst_entry_def oldDSTEntry, newDSTEntry;
short error, dateAndTime[8], errorMask;
long long timeStampLow, timeStampHigh;
/* Modify the third transition added by the DST_TRANSITION_ADD_
procedure above */
dateAndTime[0] = 1992; /* year */
dateAndTime[1] = 4; /* month */
dateAndTime[2] = 12; /* day */
dateAndTime[3] = 2; /* hour */
dateAndTime[4] = 0; /* minute */
dateAndTime[5] = 0; /* second */
dateAndTime[6] = 0; /* millisecond */
dateAndTime[7] = 0; /* microsecond */
timeStampLow = COMPUTETIMESTAMP(dateAndTime, &errorMask);
if (errorMask != 0) errorExit();
dateAndTime[0] = 1992; /* year */
dateAndTime[1] = 10; /* month */
dateAndTime[2] = 18; /* day */
dateAndTime[3] = 2; /* hour */
dateAndTime[4] = 0; /* minute */
dateAndTime[5] = 0; /* second */
dateAndTime[6] = 0; /* millisecond */
1. Existing transitions with nonzero offsets can be modified if the new values will
not overlap other existing transitions that have nonzero offsets.
2. Calling the DST_TRANSITION_MODIFY_ procedure with the z_offset field set
to zero in the second structure deletes the entry described by the first structure.
WARNING. If the entry that is currently in effect is modified and the offset value is changed,
then you should be aware that there will be jumps in the Local Civil Time. If your applications
cannot tolerate such jumps, then you should not attempt to modify the entry that is currently in
effect.