Here you can find the source of between(Date beginDate, Date endDate)
public static long between(Date beginDate, Date endDate)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static long between(Date beginDate, Date endDate) { Calendar calBegin = Calendar.getInstance(); Calendar calEnd = Calendar.getInstance(); calBegin.setTime(beginDate);//from w ww.j a va 2 s .c o m calEnd.setTime(endDate); calBegin.clear(14); calEnd.clear(14); long millisecs = calBegin.getTime().getTime() - calEnd.getTime().getTime(); long remainder = millisecs % 0x5265c00L; return (millisecs - remainder) / 0x5265c00L; } }