Here you can find the source of getTimestampl(Date time1, Date time2)
public static long getTimestampl(Date time1, Date time2)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static long getTimestampl(Date time1, Date time2) { if (time1 == null || time2 == null) { return 0; }/* w w w. j a va 2 s. c o m*/ Calendar cal = Calendar.getInstance(); cal.setTime(time1); long m1 = cal.getTimeInMillis(); cal.setTime(time2); long m2 = cal.getTimeInMillis(); long between_sec = (m2 - m1); return between_sec; } }