* fix for 17123, rounding issues decodedatetime

git-svn-id: trunk@15804 -
This commit is contained in:
marco 2010-08-13 23:36:07 +00:00
parent 9883c06545
commit d39c2ed039

View File

@ -1530,8 +1530,14 @@ end;
Procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word);
begin
DecodeDate(AValue,AYear,AMonth,ADay);
DecodeTime(AValue,AHour,AMinute,ASecond,AMilliSecond);
if AHour=24 then // can happen due rounding issues mantis 17123
begin
AHour:=0; // rest is already zero
DecodeDate(round(AValue),AYear,AMonth,ADay);
end
else
DecodeDate(AValue,AYear,AMonth,ADay);
end;