日期验证无法正常工作。 如果日= 90,月= 1和年= 1990 验证不起作用。它将日期切换为行军,而无需验证。 我如何验证它?日期验证不起作用
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
Date date;
try {
date = formatter.parse(day + "/" + month + "/" + year);
} catch (ParseException e) {
error = Boolean.TRUE;
errorMessage = "Invalid date";
return null;
}
它是重复的,我的不好,我会删除它。 – pringlesinn 2011-03-01 18:22:40