Java Timestamp Parse string2Timestamp(String value)

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

Description

string Timestamp

License

Open Source License

Declaration

@SuppressWarnings("null")
public static Timestamp string2Timestamp(String value) 

Method Source Code


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

import java.sql.Timestamp;

public class Main {

    @SuppressWarnings("null")
    public static Timestamp string2Timestamp(String value) {
        if (value == null && !"".equals(value.trim())) {
            return null;
        }/*from  w  w w  .  j  a va2  s . co  m*/
        Timestamp ts = new Timestamp(System.currentTimeMillis());
        ts = Timestamp.valueOf(value);
        return ts;
    }
}

Related

  1. str2Timestamp(String str)
  2. String2Timestamp(String date)
  3. String2Timestamp(String s, String fmt)
  4. string2Timestamp(String strDateTime, String pattern)
  5. String2Timestamp(String strInputDate)
  6. stringToTimestamp()
  7. stringToTimestamp(final String dateString)
  8. stringToTimestamp(String aS_Timestamp, String aS_Format, Timestamp aTs_ValidStart, Timestamp aTs_ValidEnd)
  9. stringToTimestamp(String date, String formatStr)