Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 36
Interacting With the DST Transition Table
dateAndTime[7] = 0; /* microsecond */
timeStampHigh = COMPUTETIMESTAMP(dateAndTime, &errorMask);
if (errorMask != 0) errorExit();
oldDSTEntry.z_lowgmt = timeStampLow;
oldDSTEntry.z_highgmt = timeStampHigh;
oldDSTEntry.z_offset = 3600; /* seconds in 1 hour */
oldDSTEntry.z_version = DST_VERSION_SEP1997;
newDSTEntry.z_lowgmt = timeStampLow;
newDSTEntry.z_highgmt = timeStampHigh;
newDSTEntry.z_offset = 7200; /* seconds in 2 hours */
newDSTEntry.z_version = DST_VERSION_SEP1997;
error = DST_TRANSITION_MODIFY_(&oldDSTEntry, &newDSTEntry);
if (error != ZSYS_VAL_DST_OK) errorExit();
.
.
.
.
Using the DST_GETINFO_ Procedure
You supply a Julian timestamp and a pointer to the zsys_ddl_dst_entry_def structure.
DST_GETINFO_ fills in the fields of the zsys_ddl_dst_entry_def structure with
information about the DST entry that was, is, or will be in effect at the time specified by
the Julian timestamp.
#include <zsysc>
#include <cextdecs(COMPUTETIMESTAMP,DST_GETINFO_)>
zsys_ddl_dst_entry_def oldDSTEntry, newDSTEntry;
short error, dateAndTime[8], errorMask;
long long timeStampLow, timeStampHigh;
/* Use the DST_GETINFO_ procedure to print the contents of the
DST
transition table */
DSTEntry.z_version = ZSYS_VAL_DST_VERSION_SEP1997;
/* Calling DST_GETINFO_ with -1 for timestamp returns the first
nonzero DST transition */
error = DST_GETINFO_(-1, &DSTEntry);
while (error == 0)
{
printDSTEntry(&DSTEntry);
error = DST_GETINFO_(DSTEntry.z_highgmt, &DSTEntry);
}