GetDatetimeDifference (open)
Get difference between two datetimes
Syntax
LOADLIB "wh::datetime.whlib";
RECORD FUNCTION GetDatetimeDifference(DATETIME fromdate, DATETIME todate)Parameters
DATETIME fromdateSource date
DATETIME todateDestination date (the 'later' date, if you want a positive result)
Return value
RECORDA record explaining the difference. The days, msecs and totalmsecs cells will always have the same sign (ie, if days is positive, then msecs is positive). If one of the arguments is DEFAULT DATETIME the function will return DEFAULT RECORD.
INTEGER daysThe total difference in days
INTEGER msecsThe remaining difference in milliseconds
INTEGER64 totalmsecsThe total difference in milliseconds
INTEGER yearsThe number of anniversaries between the dates
Description
This function returns the difference between two timestamps, split into days and milliseconds