Here you can find the source of daysFromBinStart(Calendar date)
public static int daysFromBinStart(Calendar date)
//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); } }