Here you can find the source of secondBetweenDate(Date date1, Date date2)
public static long secondBetweenDate(Date date1, Date date2)
//package com.java2s; import java.util.Date; public class Main { public static long secondBetweenDate(Date date1, Date date2) { long d = date1.getTime() - date2.getTime(); return d / 1000; }/* ww w. j a va 2 s . c o m*/ }