Java Date Between daysBetween(Date d1)

Here you can find the source of daysBetween(Date d1)

Description

days Between

License

Open Source License

Declaration

public static int daysBetween(Date d1) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    private static Calendar cal = new GregorianCalendar();

    public static int daysBetween(Date d1) {
        return (int) ((cal.getTime().getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
    }//from ww w  .j ava2 s.  com
}

Related

  1. betweenHour(Date date, int hour)
  2. betweenInDay(Date date, Date start, Date end)
  3. betweenStartDateAndEndDate(Date startDate, Date endDate)
  4. betweenStrict(Date kezdet, Date datum, Date veg)
  5. betweenTwoDates(Date date1, Date date2)
  6. daysBetween(Date d1, Date d2)
  7. daysBetween(Date date1, Date date2)
  8. DaysBetween(Date date1, Date date2)
  9. daysBetween(Date smdate, Date bdate)