mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 22:59:29 +02:00
* fix for 037361 daysbetween if parameters are swapped and cross "0" boundery.
git-svn-id: trunk@45793 -
This commit is contained in:
parent
6e9095be79
commit
3b60890373
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user