Java Day From daysOfTwo(Date date1, Date date2)

Here you can find the source of daysOfTwo(Date date1, Date date2)

Description

days Of Two

License

Apache License

Declaration

public static int daysOfTwo(Date date1, Date date2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {

    public static int daysOfTwo(Date date1, Date date2) {
        Calendar aCalendar = Calendar.getInstance();
        aCalendar.setTime(date1);//from   w  w w  .jav a  2 s.  com
        int day1 = aCalendar.get(Calendar.DAY_OF_YEAR);
        aCalendar.setTime(date2);
        int day2 = aCalendar.get(Calendar.DAY_OF_YEAR);
        return day2 - day1;

    }
}

Related

  1. daysAfter(Date earlierDate, Date laterDate)
  2. daysAndHours(int hours)
  3. daysBetweenTime(long start, long end)
  4. daysInFebruary(int year)
  5. daysInMonthForYear(int commonMonthIndex, int yearInteger)
  6. daysSince(Date since)
  7. dayStartTime(int day)
  8. distanceToNowInDaysIgnoreTime(Date date)
  9. equalsDay(final Date date1, final Date date2)