Java Timestamp Create toTimestamp(String _sDate)

Here you can find the source of toTimestamp(String _sDate)

Description

to Timestamp

License

Open Source License

Declaration

public static Timestamp toTimestamp(String _sDate) 

Method Source Code


//package com.java2s;

import java.sql.Timestamp;

public class Main {

    public static Timestamp toTimestamp(String _sDate) {
        Timestamp ts = null;//from w w  w.ja  v a  2  s.c o m
        if (_sDate == null || "".equals(_sDate)) {
            return null;
        }
        ts = Timestamp.valueOf(_sDate + " 00:00:00.000000000");
        return ts;
    }
}

Related

  1. toTimestamp(java.sql.Date date)
  2. toTimestamp(long ts)
  3. toTimestamp(long value)
  4. toTimestamp(Object dateobj)
  5. toTimestamp(Object objInParam)
  6. toTimestamp(String dateTime)
  7. toTimestamp(String dateTime)
  8. toTimestamp(String dt)
  9. toTimestamp(String s)