You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rodolfo García Esteban/CYII <rg...@cyii.es> on 2005/04/27 09:53:49 UTC

TimeStamp validator

Hi,

I use GenericValidator.isDate(), when I try to 
validate with the pattern "dd/MM/yyyy" works well, but when I use the 
pattern "dd/MM/yyyy hh:mm:ss", doesn't work well, it returns false when 
checks a valid string. How  I can validate this pattern date?. Is there 
any timeStampValidator or something like that?

Thanks in advance,

________________________
Rodolfo 

Re: TimeStamp validator

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Hola Rodolfo,
The javadoc for isDate states that the pattern is used with SimpleDateFormat.
Maybe your pattern is not correct for the validation your need.
Can you give us the pattern and the String to validate.



public static boolean *isDate*(java.lang.String value,
                             java.lang.String datePattern,
                             boolean strict)

Checks if the field is a valid date. The pattern is used with 
|java.text.SimpleDateFormat.


|Rodolfo García Esteban/CYII wrote:

>Hi,
>
>I use GenericValidator.isDate(), when I try to 
>validate with the pattern "dd/MM/yyyy" works well, but when I use the 
>pattern "dd/MM/yyyy hh:mm:ss", doesn't work well, it returns false when 
>checks a valid string. How  I can validate this pattern date?. Is there 
>any timeStampValidator or something like that?
>
>Thanks in advance,
>
>________________________
>Rodolfo 
>
>  
>

-- 

José Antonio Pérez Testa
Ingeniería de Servicios e Innovación técnologica.

Telémaco 3
28027 - Madrid (ESPAÑA)
Tel: +34-91-480.81.12
 
japtesta@indra.es
www.indra.es


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org