Why the date printed is 00
instead of 01
?
DateFormat myFormatter = new SimpleDateFormat("dd/MM/yyyy");
Date newDate = myFormatter.parse("01/02/2016"); //assume date today is Feb 01, 2016
System.out.println(myFormatter.format(newDate));
Date printed in the console is: 00/02/2016
But what i wanted to have is: 01/02/2016
Please can someone explain what could be gone wrong in my code? And how I can fix it?
P.S: February in 2016 having 29 days