Java Timestamp Create getTimestampFromString(String id)

Here you can find the source of getTimestampFromString(String id)

Description

get Timestamp From String

License

Open Source License

Declaration

public static long getTimestampFromString(String id) throws ParseException 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.text.ParseException;

public class Main {
    public static long getTimestampFromString(String id) throws ParseException {
        String a[] = id.split("-");
        return new SimpleDateFormat("yyyyMMddHHmmss").parse(a[1]).getTime() / 1000;
    }/*  w  ww  . jav  a  2s.c  om*/
}

Related

  1. getTimestampFromDate(String d)
  2. getTimestampFromDateTime(DateTime dateTime)
  3. getTimeStampFromISOString(String isoString)
  4. getTimestampFromString(String dateStr)
  5. getTimestampFromString(String dateString, String dateFormat)
  6. getTimestampFromString(String s)
  7. getTimeStampFromString(String timeStamp)
  8. getTimestampInEnglish(java.sql.Timestamp t)
  9. getTimestampLexical(boolean showSeconds, Locale locale)