Title: Date validation

Hi


Can you please tell me how to validate if a date entered is a valid date.
FOr ex an invalid date is 02-29-2001(29 feb 2001). But when creating a date
object using the code below no exception is thrown. It instead turns the date into
01-03-2001.

                java.text.SimpleDateFormat s = new
java.text.SimpleDateFormat ("MM-dd-yyyy");
                java.util.Date d = s.parse(Date, new
java.text.ParsePosition(0));
                Timestamp t = new Timestamp(d.getTime());


I would greatly appreciate an early reply.
Many thanks in advance

regards

Mario

Reply via email to