Java Date Difference daysDiff(Date d1, Date d2)

Here you can find the source of daysDiff(Date d1, Date d2)

Description

days Diff

License

LGPL

Declaration

public static long daysDiff(Date d1, Date d2) 

Method Source Code


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

import java.util.*;

public class Main {
    public static long daysDiff(Date d1, Date d2) {

        long t1 = d1.getTime();
        long t2 = d2.getTime();

        return (t1 - t2) / (1000 * 60 * 60 * 24);
    }// www  .j  a v a2  s.  c  o  m
}

Related

  1. dateDiffWithNow(Calendar sDate)
  2. dayDiff(Date a, Date b)
  3. dayDiff(Date date1, Date date2)
  4. dayDiff(Date first, Date second)
  5. dayDiffByStartOfDay(Date a, Date b)
  6. diff(Date d1, Date d2)
  7. diff(Date date1, Date date2)
  8. diff(Date date1, Date date2)
  9. diff(Date endDate, Date startDate)