* Merging revisions 43615 from trunk:

------------------------------------------------------------------------
    r43615 | joost | 2019-11-30 12:04:19 +0100 (Sat, 30 Nov 2019) | 1 line
    
     * Fix for timestamps very close to a whole day in Firebird
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43656 -
This commit is contained in:
michael 2019-12-06 10:00:01 +00:00
parent b3dbf75026
commit 9c1d71246c

View File

@ -1442,6 +1442,13 @@ begin
{$ELSE}
PISC_TIMESTAMP(CurrBuff)^.timestamp_date := Trunc(PTime) + IBDateOffset;
PISC_TIMESTAMP(CurrBuff)^.timestamp_time := Round(abs(Frac(PTime)) * IBTimeFractionsPerDay);
if PISC_TIMESTAMP(CurrBuff)^.timestamp_time = IBTimeFractionsPerDay then
begin
// If PTime is for example 0.99999999999999667, the time-portion of the
// TDateTime is rounded into a whole day. Firebird does not accept that.
inc(PISC_TIMESTAMP(CurrBuff)^.timestamp_date);
PISC_TIMESTAMP(CurrBuff)^.timestamp_time := 0;
end;
{$ENDIF}
end
else