Here you can find the source of getDiscrepancyNum(Timestamp time1, Timestamp time2)
public static int getDiscrepancyNum(Timestamp time1, Timestamp time2)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { public static int getDiscrepancyNum(Timestamp time1, Timestamp time2) { int result = 0; if (time1 != null && time2 != null) { long temp = time1.getTime() - time2.getTime(); if (temp > 0) { result = (int) ((temp / (24 * 60 * 60 * 1000))); } else { result = -(int) (((temp / (24 * 60 * 60 * 1000)))); }/* www . j ava 2 s .c o m*/ } return result; } }