public int diff(int year1,int month1, int day1,int year2, int month2,int day2){
        int days1 = year1*365 + day1;
        int days2 = year2*365 + day2;
        
        for(int i=0; i < month1-1; i++){
            days1 = days1 + days[i];
        }
    
        for(int i=0; i < month2-1; i++){
            days2 = days2 + days[i];
        }
        
        days1 = days1 + (year1-1)/4  - (year1 -1)/100 + (year1 -1 )/400; 
        days2 = days2 + (year2-1)/4  - (year2 -1)/100 + (year2 -1 )/400; 
        
        if(isLeapYear(year1) && month1 > 2){
            days1++;
        }
        if(isLeapYear(year2) && month2 > 2){
            days2++;
        }
        
        return days2 - days1;
    }
Number of days between two valid dates
The idea is to get number of days from 00/00/0000 for both the dates and find the
difference between them.
src/com/interview/misc/DayDifferenceBetweenTwoDates.java