mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 13:09:11 +02:00
* fix for 17123, rounding issues decodedatetime
git-svn-id: trunk@15804 -
This commit is contained in:
parent
9883c06545
commit
d39c2ed039
@ -1530,8 +1530,14 @@ end;
|
|||||||
|
|
||||||
Procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word);
|
Procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word);
|
||||||
begin
|
begin
|
||||||
DecodeDate(AValue,AYear,AMonth,ADay);
|
|
||||||
DecodeTime(AValue,AHour,AMinute,ASecond,AMilliSecond);
|
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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user