mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 01:09:25 +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;
|
Function DaysBetween(const ANow, AThen: TDateTime): Integer;
|
||||||
begin
|
begin
|
||||||
Result:=Trunc(Abs(DateTimeDiff(ANow,AThen))+HalfMilliSecond);
|
if anow>athen then
|
||||||
end;
|
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;
|
Function HoursBetween(const ANow, AThen: TDateTime): Int64;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user