Here you can find the source of getUnixTime(Date date)
public static long getUnixTime(Date date)
//package com.java2s; //License from project: LGPL import java.util.Calendar; import java.util.Date; public class Main { public static long getUnixTime(Date date) { Calendar instance = Calendar.getInstance(); instance.setTime(date);// w w w .j a v a2 s . c om long utc = Date.UTC(instance.get(Calendar.YEAR) - 1900, instance.get(Calendar.MONTH), instance.get(Calendar.DAY_OF_MONTH), instance.get(Calendar.HOUR_OF_DAY), instance.get(Calendar.MINUTE), instance.get(Calendar.SECOND)); return utc; } }