Java Timestamp strToTimestamp(String date)

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

Description

str To Timestamp

License

Open Source License

Declaration

public static Timestamp strToTimestamp(String date) throws ParseException 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static Timestamp strToTimestamp(String date) throws ParseException {
        Date day = strToDate(date);
        return new Timestamp(day.getTime());
    }/*from  www  .  j av a2 s.  c om*/

    public static Date strToDate(String date) throws ParseException {
        DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
        Date day = df.parse(date);
        return day;
    }
}

Related

  1. sqlDateConvertoStr(Timestamp date)
  2. sqlDateToCalendar(Timestamp date)
  3. SQLTimestampToDate(java.sql.Timestamp ts)
  4. sqlTimestampToDate(Timestamp t)
  5. StrToDateTimeFormat(String timestampStr,String pattern)
  6. strToTimestamp(String dateStr)
  7. strToTimestamp(String i_Today, String i_Hour, String i_Minute)
  8. StrToTimestamp(String timestampStr,String pattern)
  9. timestamp()