Java Timestamp Create getTimestamp(String Str)

Here you can find the source of getTimestamp(String Str)

Description

get Timestamp

License

Open Source License

Declaration

public static Timestamp getTimestamp(String Str) 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

public class Main {

    public static Timestamp getTimestamp(String Str) {
        Timestamp time = null;//from  ww w  .  j  av a2 s .c  o m
        try {
            time = java.sql.Timestamp.valueOf(Str);
        } catch (Exception e) {
            System.out.println("getTimestamp error:" + e);
        }
        return time;
    }
}

Related

  1. getTimestamp(String date, String time)
  2. getTimestamp(String dateStr)
  3. getTimestamp(String dateString, String format)
  4. getTimestamp(String sqlDateTime)
  5. getTimestamp(String str)
  6. getTimestamp(String strDate)
  7. getTimestamp(String time, String pattern)
  8. getTimestamp2()
  9. getTimeStampAsString(Timestamp formatTime)