previous next top contents index framed top this page unframed
Figure 30–8. $addToDateAndTime
| BOOLEAN PROCEDURE $addToDateAndTime (LONG INTEGER date,time; LONG INTEGER daysToAdd, secondsToAdd; PRODUCES LONG INTEGER newDate,newTime; OPTIONAL BITS ctrlBits); |
$addToDateAndTime performs addition on a date and time. newDate and newTime are the resulting date and time after daysToAdd and secondsToAdd have been added to date and time, respectively.
daysToAdd and secondsToAdd are interpreted as date and time differences (even if they fall outside the normal date and time difference range). The absolute value of secondsToAdd may exceed one day, and daysToAdd and secondsToAdd need not have the same sign.
date and time may be an absolute (GMT or local) date and time, or they may be a date and time difference. newDate and newTime have the same format (GMT, local, or difference) as date and time.
If either date or time is invalid, or if date and time do not have the same format, an error occurs, FALSE is returned, and both newDate and newTime are set to 0L.
The only valid ctrlBits bit is errorOK. Unless it is specified, an error message is generated for erroneous input values.
The standard MAINSAIL date and time formats are described in Section 24.1. Adding a number of days to a given date by itself or adding a number of seconds to a given time of day by itself may be accomplished by means of the LONG INTEGER “+” operator.
MAINSAIL Language Manual, Section 30.7