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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…