I'm using
java.util.Date date;
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
try {
date = sdf.parse(inputString);
} catch (ParseException e) {
e.printStackTrace();
}
where inputString
is a string in the dd/MM/yyyy
format.
If the inputString
is, for example, 40/02/2013, I would to obtain an error, instead the parse method returns the Date 12 March 2013 (12/03/2013).
What I'm wronging?
Set the Leniency bit:
The following code:
Gives:
Notes