Java Calendar Day daysFromBinStart(Calendar date)

Here you can find the source of daysFromBinStart(Calendar date)

Description

days From Bin Start

License

Apache License

Declaration

public static int daysFromBinStart(Calendar date) 

Method Source Code

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

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    private static long numberOfMSInADay = 1000 * 60 * 60 * 24;
    public static Calendar startDateForBinning = new GregorianCalendar(2009, 0, 3);

    public static int daysFromBinStart(Calendar date) {

        return numberOfDaysBetween(startDateForBinning, date);
    }/*  w  ww.j a  va2s  .  c  o m*/

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

        long span = end.getTimeInMillis() - start.getTimeInMillis();
        return (int) (span / numberOfMSInADay);
    }
}

Related

  1. dayEndTime(Calendar calendar)
  2. dayFloor(Calendar calendar)
  3. dayIterable(Calendar from, Calendar to)
  4. dayMarkToCalendar(int day)
  5. dayPrecision(Calendar calendar)
  6. daysSinceTheJesus(Calendar cal)
  7. dayStart(Calendar date)
  8. dayStart(final Calendar cal)
  9. decreaseByDay(final Calendar calendar)