I have a method which uses following logic to calculate difference between days.
long diff = milliseconds2 - milliseconds1; long diffDays = diff / (24 * 60 *
just parse 9th feb 2011 & 19th feb 2011 into dates using SimpleDateFormat and convert it to start & end millis and apply your calculation
9th feb 2011
19th feb 2011