Java String to Timestamp getTimeStamp(String date)

Here you can find the source of getTimeStamp(String date)

Description

get Time Stamp

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static String getTimeStamp(String date) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from   w ww .j av  a2 s.  co m
     *
     * @param date
     * @return
     */
    public static String getTimeStamp(String date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        ParsePosition pos = new ParsePosition(0);
        Date d = formatter.parse(date, pos);
        return String.valueOf(d.getTime());
    }
}

Related

  1. calculateClientRequestId(String timestamp)
  2. getFileNameWithTimeStampInterposed(final String fileName)
  3. getStringToTimestamp(String string)
  4. getTimeStamp(String dateTime)
  5. getTimestamp(String dateValue, String pattern, TimeZone timezone)
  6. getTimestamp(String pattern)
  7. getTimeStamp(String pattern, String strDate)