posted 19 years ago
Hi all,
The following is the code I am using to check the validity of the date. It was working fine till December 30. However it started trowing the "java.lang.IllegalArgumentException" starting from dec 31st, 2004. I am not sure why. But if I comment the "calendar.setLenient(false)" everything works fine. Any help would be highly appreciated.
try
{
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setLenient(false);
calendar.set(1966, 10, 21);
calendar.getTime();//throws if invalid
}
catch(Exception e)
{
}
SCJP2<br />BEA Certified J2EE Developer