Here you can find the source of diff(Date subtrahend, Date minuend, long diffField)
public static long diff(Date subtrahend, Date minuend, long diffField)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static long diff(Date subtrahend, Date minuend, long diffField) { long diff = minuend.getTime() - subtrahend.getTime(); return diff / diffField; }//from w w w .j a v a 2 s . c o m }