previous next top contents index framed top this page unframed
Figure 33–5. $dateAndTimeCompare
| INTEGER PROCEDURE $dateAndTimeCompare (LONG INTEGER d1,t1,d2,t2; OPTIONAL BITS ctrlBits); |
$dateAndTimeCompare compares two dates and times.
If the two dates and times are absolute (GMT or local, but they need not be the same format; i.e., the start time may be GMT and the stop time local or vice versa, provided that time conversion is available), $dateAndTimeCompare returns -1 if the time represented by the date d1 and the time t1 is before the time represented by the date d2 and the time t2, 0 if the two times are the same, and 1 if the first time is after the second. If the two dates and times are differences, $dateAndTimeCompare returns -1 if the interval represented by the number of days d1 and the number of seconds t1 is less than the interval represented by the number of days d2 and the number of seconds t2, 0 if the two intervals are the same, and 1 if the second interval is greater than the first.
If input values are invalid or of incompatible formats, -2 is returned and, unless the ctrlBits bit errorOK is set, an error message is issued.
The standard MAINSAIL date and time formats are described in Section 24.1.
MAINSAIL Language Manual, Section 33.5