date_compare()

Purpose

Compares two dates (new version)

Syntax

int date_compare(datetype* date1, datetype* date2);

Parameters

datetype* date1

One of the dates for comparison

 

datetype* date2

The other date for comparison

Description

The date_compare() function compares two dates to test whether they are the same or if not, which one is the earlier and which the later.

This function is more efficient than date_subtract_date().

Return values

Returns 1 if date1 is after date2, -1 if date2 is after date1 or 0 if they are the same