Here you can find the source of toUnixTime(Date date)
public static long toUnixTime(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static long toUnixTime(Date date) { return toUnixTime(date.getTime()); }/*from ww w .j a v a 2 s .co m*/ public static long toUnixTime(long millisSinceEpoch) { return TimeUnit.MILLISECONDS.toSeconds(millisSinceEpoch); } }