* replace encodedate/time by try variants mantis 14969

git-svn-id: trunk@14110 -
This commit is contained in:
marco 2009-11-08 11:43:01 +00:00
parent 33a26ab16a
commit 887d8a9d92

View File

@ -469,7 +469,8 @@ begin
if (defs.TwoDigitYearCenturyWindow > 0) and (Y < ly) then
Inc(Y, 100);
end;
Result := EncodeDate(y, m, d);
if not TryEncodeDate(y, m, d, result) then
errormsg:='Invalid date';
end;
function StrToDate(const S: PChar; Len : integer; const useformat : string; separator : char = #0): TDateTime;
@ -600,7 +601,9 @@ begin
if (pm=1) and ((TimeValues[0]=12)) then
TimeValues[0]:=0;
end;
result := EncodeTime(TimeValues[0], TimeValues[1], TimeValues[2], TimeValues[3]);
if not TryEncodeTime(TimeValues[0], TimeValues[1], TimeValues[2], TimeValues[3],result) Then
errormsg:='Invalid time.';
end ;
function StrToTime(const S: PChar; Len : integer; separator : char = #0): TDateTime;