Ver Mensaje Individual
  #2  
Antiguo 08-06-2008
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Una posible solución, que encontré en Torry's, es usar cierta función de la unidad "SysUtils" y comprobar si se produce una excepción o no:

Código Delphi [-]
function IsValidDate(AString : string; 
 var ADateTime : TDateTime): Boolean;
begin
  Result := True;
  try
    ADateTime := StrToDateTime(AString);
  except
    ADateTime := 0;
    Result := False;
  end;
end;
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita