Java Timestamp dateStringToTimestamp(String dateStr)

Here you can find the source of dateStringToTimestamp(String dateStr)

Description

date String To Timestamp

License

Open Source License

Declaration

public static Timestamp dateStringToTimestamp(String dateStr) 

Method Source Code


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

import java.sql.Timestamp;

public class Main {
    public static Timestamp dateStringToTimestamp(String dateStr) {
        Timestamp ts = new Timestamp(System.currentTimeMillis());
        dateStr += " 00:00:00";
        try {/* w  w w  .jav a  2s. co m*/
            ts = Timestamp.valueOf(dateStr);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ts;
    }
}

Related

  1. date2Timestamp(Date value)
  2. dateAdd(Timestamp t1, Integer i, int type)
  3. dateAndTimeToTimestamp(Date data, Time hora)
  4. dateIntToTimestamp(int dateInt)
  5. datesDiffer(Timestamp a, Timestamp b)
  6. datetime2ToTimestamp(long value, int fraction, int width)
  7. dateTimeToString(Timestamp dt, String df)
  8. dateToOracleStr(java.sql.Timestamp ts)
  9. dayNumber(Timestamp stamp)