* Fixed TryStrToDateTime so it returns True only if both date and time are parsed successfully, resolves #17541.

git-svn-id: trunk@16099 -
This commit is contained in:
sergei 2010-10-07 09:48:18 +00:00
parent 69d85d5b2d
commit 6a9a991dca

View File

@ -1294,7 +1294,7 @@ var
I: integer;
dtdate, dttime :TDateTime;
begin
result:=true;
result:=false;
I:=Pos(FormatSettings.TimeSeparator,S);
If (I>0) then
begin
@ -1307,6 +1307,7 @@ begin
if not TryStrToTime(Copy(S,i+1, Length(S)-i),dttime,Formatsettings) then
exit;
Value:=ComposeDateTime(dtdate,dttime);
result:=true;
end
else
result:=TryStrToTime(s,Value,Formatsettings);