Here you can find the source of convertDateToTimeStamp(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static long convertDateToTimeStamp(Date date)
//package com.java2s; /**/*from w w w. j av a 2 s. c om*/ * Copyright (C) 2013 Company. All Rights Reserved. * * This software is the proprietary information of Company . * Use is subjected to license terms. * * @since Jul 17, 2013 11:48:25 PM * @author SPA * */ import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /** * This method is used for converting date to time stamp in long * * @param date * @return */ public static long convertDateToTimeStamp(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar.getTimeInMillis(); } }