I have the next problem with dates when I work with java. I have this code:
String dateF=anio_final+"-12-31";
System.out.println("La fecha final al principio:"+dateF);
java.util.Date f_final=null;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd");
f_final=formatter.parse(dateF);
System.out.println("Al final la fecha final es:"+f_final);
//=> anio_final is 2012,
So when I print dateF I get 2012-12-31 but when I do the SimpleDateFormat to put it on the f_final variable I get 2012-01-31, why?
From SimpleDateFormat, month of the year is denoted by
Uppercase M.Lowercase mis forminute: –should be: –