I am facing a problem when i am trying to get the difference between two dates which is been taken from html page through datepicker.
now i am selecting two different dates with different month.for example
d1 dd/mm/yyyy = 12/09/2008
d2 dd/mm/yyyy = 2/10/2008
now i am getting this value in the text box through datepicker.so i am doing it like this to convert it ,first i am getting the parameters by using
SimpleDateFormat df = new SimpleDateFormat("dd/mm/yyyy");
Date d1 = df.parse(datefrom);
Date d2 = df.parse(dateto);
String days1 = new StringBuffer("").append(days).toString();
But the problem is that it is not taking the proper selected september and october month else it is showing as only january month for any selected month
Thu Jan 12 00:09:00 GMT+05:30 2008 for d1
wed Jan 02 00:09:02 GMT+05:30 2008 for d2
Please help me out.
Thanks in advance.