Here you can find the source of getTimeStamp(String date)
Parameter | Description |
---|---|
date | a parameter |
public static String getTimeStamp(String date)
//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()); } }