Java tutorial
//package com.java2s; import java.util.Date; public class Main { public static long diff(Date subtrahend, Date minuend, long diffField) { long diff = minuend.getTime() - subtrahend.getTime(); return diff / diffField; } }