Mega Code Archive

 
Categories / Delphi / Algorithm Math
 

Check the validity of dates

Title: Check the validity of dates Use StrToDate function and try ... except construction: procedure TForm1.Button1Click(Sender: TObject); begin try StrToDate(MaskEdit1.Text); Label2.Caption:='Valid Date'; except on EConvertError do Label2.Caption:='Not Valid Date'; end; end;