Java Date Difference dateDiff(Date beginDate, Date endDate)

Here you can find the source of dateDiff(Date beginDate, Date endDate)

Description

date Diff

License

Apache License

Declaration

public static long dateDiff(Date beginDate, Date endDate) 

Method Source Code

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

import java.util.*;

public class Main {

    public static long dateDiff(Date beginDate, Date endDate) {
        long beginDateseconds = beginDate.getTime();
        long endDateseconds = endDate.getTime();
        long diff = endDateseconds - beginDateseconds;
        long diffDays = diff / (24 * 60 * 60 * 1000);
        return diffDays;
    }//from   w ww  .j ava  2  s .  co m
}

Related

  1. dateDiff(Date d1, Date d2, int field)
  2. dateDiff(Date date1, Date date2)
  3. dateDiff(Date date1, Date date2)
  4. dateDiff(Date date1, Date date2)