Android examples for java.util:Date Timestamp
Create an unix timestamp of a date object
//package com.java2s; import java.util.Date; public class Main { /**//from w w w .j av a2s . c om * Create an unix timestamp of a date object * @param date * @return seconds since 1970-1-1 */ public static Long toUnixtimeTimestamp(Date date) { if (date == null) { return null; } return date.getTime() / 1000L; } }