Java Timestamp Parse parseTimeStamp(final String... key)

Here you can find the source of parseTimeStamp(final String... key)

Description

parse Time Stamp

License

Open Source License

Declaration

public static Timestamp parseTimeStamp(final String... key) throws ParseException 

Method Source Code


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

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

    public static Timestamp parseTimeStamp(final String... key) throws ParseException {
        final String dateStr = key[0] + "-" + key[1] + "-" + key[2] + " " + key[3] + ":" + key[4] + ":" + key[5];
        return new Timestamp(format.parse(dateStr).getTime());
    }//  ww  w  .ja v a 2 s .  c o  m
}

Related

  1. parseStopTime(String timestamp, String timezone)
  2. parseTimestamp(Date date)
  3. parseTimestamp(Date date)
  4. parseTimestamp(final String format, final String time)
  5. parseTimestamp(final String s)
  6. parseTimestamp(Long time, String pattern)
  7. parseTimestamp(Object o)
  8. parseTimestamp(String d)
  9. parseTimestamp(String date)