mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 16:40:25 +02:00
* Fix for timestamps very close to a whole day in Firebird
git-svn-id: trunk@43615 -
This commit is contained in:
parent
4e4f55ac0e
commit
d8c81744d3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user