Java Date Convert convertDateToTimeStamp(Date date)

Here you can find the source of convertDateToTimeStamp(Date date)

Description

This method is used for converting date to time stamp in long

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static long convertDateToTimeStamp(Date date) 

Method Source Code

//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();
    }
}

Related

  1. ConvertDateToAge(String date)
  2. convertDateToDoubleTime(Date time)
  3. convertDateToInt(final Date date)
  4. convertDateToLong(int year, int month, int day, int hour, int minute, int second)
  5. convertDateToServerTimeZoneDateInMilliSec(String timeZoneName, long milliSecond)
  6. convertDateToUTC(Date date)
  7. convertDateToWindowsTime(Date javaDate)
  8. convertDateValueToMillis(TimeZone tz, long dateValue)
  9. convertDoubleTimeToDate(Number d)