Java Day End getDistDates(Date startDate, Date endDate)

Here you can find the source of getDistDates(Date startDate, Date endDate)

Description

get Dist Dates

License

Open Source License

Declaration

public static long getDistDates(Date startDate, Date endDate) 

Method Source Code

//package com.java2s;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static long getDistDates(Date startDate, Date endDate) {
        long totalDate = 0;
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(startDate);/*from  ww  w  . j av  a2s.  c  o m*/
        long timestart = calendar.getTimeInMillis();
        calendar.setTime(endDate);
        long timeend = calendar.getTimeInMillis();
        totalDate = Math.abs((timeend - timestart)) / (1000 * 60 * 60 * 24);
        return totalDate;
    }
}

Related

  1. getDateInterval4EndDate(Date date, int hourModify)
  2. getDateList(Date begin, Date end)
  3. getDatesBetweenTwoDate(Date beginDate, Date endDate)
  4. getDateTimeString(boolean appendMillis)
  5. getDefaultEndDateForLogQuery()
  6. getEndDate()
  7. getEndDate(Date beginDate, int resolution)
  8. getEndDate(Date date)
  9. getEndDate(Date startDate)