Java tutorial
//package com.java2s; import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static int diffDate(Date fromDay, Date toDay) { long from = fromDay.getTime(); long to = toDay.getTime(); return (int) TimeUnit.MILLISECONDS.toDays(to - from); } }