Here you can find the source of interval(Date date)
public static long interval(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static long interval(Date date) { return (Calendar.getInstance(TimeZone.getTimeZone("GMT+08:00")) .getTimeInMillis() - date.getTime()) / 1000; }/* ww w . j a va2s . c om*/ }