function IsDateTime(const ss: string): Boolean begin try StrToDateTime(ss); Result := True; except Result := False; end; end;
//补充 function IsTime(const ss: string): boolean; begin Result :=True; try StrToTime(ss); except ShowMessage(''''+ss+'''不是一个有效的时间!') Result := False; end; end;
begin
try
StrToDateTime(ss);
Result := True;
except
Result := False;
end;
end;
function IsTime(const ss: string): boolean;
begin
Result :=True;
try
StrToTime(ss);
except
ShowMessage(''''+ss+'''不是一个有效的时间!')
Result := False;
end;
end;
StrToTimeDef(edit1.text,0)