Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int calculateDays(Calendar start, Calendar end) { long diff = end.getTimeInMillis() - start.getTimeInMillis(); float dayCount = ((float) diff / (24 * 60 * 60 * 1000)); return (int) (dayCount + .5); } }