H Swetha,
Correct me if i wrong,
Suppose user give the input date as 14th Aug 2014 means you need to display 1st Aug to 14th Aug value alone right and you want to find the day difference between 14th Aug to 31st Aug as 17 its your requirement right??
Regards
Sureshkumar C