Here you can find the source of getSecondsDateDiff(Date dateStart)
public static long getSecondsDateDiff(Date dateStart)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static long getSecondsDateDiff(Date dateStart) { Calendar cal = Calendar.getInstance(); Date dateEnd = cal.getTime(); long diffInMillies = dateEnd.getTime() - dateStart.getTime(); TimeUnit timeUnit = TimeUnit.SECONDS; return timeUnit.convert(diffInMillies, TimeUnit.MILLISECONDS); }/*from w w w . j av a2 s. c o m*/ }