mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 16:30:44 +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,10 +1390,12 @@ end;
|
||||
|
||||
Function DaysBetween(const ANow, AThen: TDateTime): Integer;
|
||||
begin
|
||||
Result:=Trunc(Abs(DateTimeDiff(ANow,AThen))+HalfMilliSecond);
|
||||
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
|
||||
Result:=Trunc((Abs(DateTimeDiff(ANow,AThen))+HalfMilliSecond)*HoursPerDay);
|
||||
|
Loading…
Reference in New Issue
Block a user