datetime.diff()

Determines the number of given date parts between two different dates

datetime.diff( date1, date2 )

Returns: Number

Argument Description
date1
datetime, required

date time object to compare

date2
datetime, required

date time object to compare

Examples

date = createDateTime(1997,04,11);
	echo( date.Diff("d", "1997-04-25") & "<br>"); // 1
	dateOne = createDate(1997,04,11);
	echo( dateOne.Diff("d", "1997-04-11") & "<br>"); // 0
	datetime = createDateTime(1992,12,11,01,00,00);
	echo( datetime.Diff("h", "1992-12-11 00:00:00") & "<br>"); // -1

See also