Java Timestamp Parse stringToTimestamp(String value)

Here you can find the source of stringToTimestamp(String value)

Description

string To Timestamp

License

Open Source License

Declaration

public static Timestamp stringToTimestamp(String value) 

Method Source Code

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

import java.sql.Timestamp;

public class Main {
    public static Timestamp stringToTimestamp(String value) {
        try {//from www.j  ava 2s.  c o m
            return Timestamp.valueOf(value);
        } catch (Exception e) {
            return new Timestamp(new java.util.Date().getTime());
        }
    }
}

Related

  1. stringToTimestamp(String date, String formatStr)
  2. stringToTimeStamp(String dateTimeString, String dateTimeFormat, TimeZone tz, Locale locale)
  3. stringToTimestamp(String marcTimestamp)
  4. stringToTimestamp(String sTimestamp)
  5. stringToTimestamp(String ts)
  6. stringToTimesTamp(String yMd, boolean isEndTime)
  7. stripToMinutes(java.sql.Timestamp timestamp)