Java Calendar Between numberOfDaysBetween(Calendar start, Calendar end)

Here you can find the source of numberOfDaysBetween(Calendar start, Calendar end)

Description

number Of Days Between

License

Apache License

Declaration

public static int numberOfDaysBetween(Calendar start, Calendar end) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    private static long numberOfMSInADay = 1000 * 60 * 60 * 24;

    public static int numberOfDaysBetween(Calendar start, Calendar end) {

        long span = end.getTimeInMillis() - start.getTimeInMillis();
        return (int) (span / numberOfMSInADay);
    }//ww  w. j  ava 2 s.c  o m
}

Related

  1. getDaysBetween(final Calendar start, final Calendar end)
  2. getFmtCalendar(Calendar c, long betweenTimeout, StringBuilder sb)
  3. hoursBetween(Calendar start, Calendar end, boolean assumeSameDate)
  4. hoursBetween(Calendar startDate, Calendar endDate)
  5. isBetween(Calendar time, Calendar start, Calendar end)