nis bootwala wrote:Hi...
Is there any thing like setLenient property which I can set to false in java.util.Date and java.util.Calendar?
Thanks,
Yes, there is. Go through the methods of the Calendar class carefully in the API (link provided by Campbell in earlier post). You will find a method 'void setLenient(boolean)' which you can use to set Calendar to non-lenient mode.
Using this, 04/31 will not be converted to 05/01 rather an Exception will be thrown.