Here you can find the source of diffIntoMilliSecond(java.util.Date date, java.util.Date date1)
public static long diffIntoMilliSecond(java.util.Date date, java.util.Date date1)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static long diffIntoMilliSecond(java.util.Date date, java.util.Date date1) { if (date == null || date1 == null) return 0; Calendar cal = Calendar.getInstance(); cal.setLenient(true);/*from w w w. j av a 2 s . com*/ cal.setTime(date); long datet = cal.getTimeInMillis(); cal.setTime(date1); long date1t = cal.getTimeInMillis(); return datet - date1t; } }