Java Date Difference getDiffDays2(Date one, Date two)

Here you can find the source of getDiffDays2(Date one, Date two)

Description

get Diff Days

License

Open Source License

Declaration

public static int getDiffDays2(Date one, Date two) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {

    public static int getDiffDays2(Date one, Date two) {
        Calendar sysDate = new GregorianCalendar();

        sysDate.setTime(one);/* w ww  .j  a  v  a  2s .  co  m*/

        Calendar failDate = new GregorianCalendar();

        failDate.setTime(two);
        return (int) ((sysDate.getTimeInMillis() - failDate.getTimeInMillis()) / (24 * 60 * 60 * 1000));
    }
}

Related

  1. getDateDiffHour(String begindate, String enddate)
  2. getDayDiff(Date firstDate, Date secondDate)
  3. getDiff(Date from, Date to)
  4. getDiffDate(String srcDate, String format, int diff)
  5. getDiffDays(Date from, Date to)
  6. getDifference(Date a, Date b)
  7. getDifference(String dateStr1, String dateStr2, char choice)
  8. getDifferenceInDays(Calendar calendar0, Calendar calendar1)
  9. getDiffMon(Date dt, int idiff)