* fix for 037361 daysbetween if parameters are swapped and cross "0" boundery.

git-svn-id: trunk@45793 -
This commit is contained in:
marco 2020-07-15 17:19:01 +00:00
parent 6e9095be79
commit 3b60890373

View File

@ -1390,9 +1390,11 @@ end;
Function DaysBetween(const ANow, AThen: TDateTime): Integer;
begin
Result:=Trunc(Abs(DateTimeDiff(ANow,AThen))+HalfMilliSecond);
end;
if anow>athen then
Result:=Trunc(Abs(DateTimeDiff(ANow,AThen))+HalfMilliSecond)
else
Result:=Trunc(Abs(DateTimeDiff(AThen,ANow))+HalfMilliSecond); // bug 37361
end;
Function HoursBetween(const ANow, AThen: TDateTime): Int64;
begin