Here you can find the source of diffDateD(Date sd, Date ed)
static public int diffDateD(Date sd, Date ed) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.util.Date; public class Main { static public int diffDateD(Date sd, Date ed) throws ParseException { return Math.round((float) (ed.getTime() - sd.getTime()) / 86400000) + 1; }//from w ww . j a va2 s .c om }