Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { /** * Get the number of days between calendars * @param cIni Calendar initial * @param cEnd Calendar end * @return int num of days */ public static int getNumDays(Calendar cIni, Calendar cEnd) { long difMillis = cEnd.getTimeInMillis() - cIni.getTimeInMillis(); return (int) (difMillis / 86400000); } }