I am trying to format a string into specific date format but there is some problem in conversion. In converted string month is always coming "January". Following is the code snippet:
String date = "30/10/2012-11:11:11";
DateFormat dateForm = new SimpleDateFormat("dd/mm/yyyy-hh:mm:ss");
try {
System.out.println(dateForm.parse(date));
}
catch (ParseException e) {
e.printStackTrace();
}
I am not able to get the reason behind this. Please suggest.