Java Timestamp Create toTimestampFromTime(String time)

Here you can find the source of toTimestampFromTime(String time)

Description

to Timestamp From Time

License

Open Source License

Declaration

public static Timestamp toTimestampFromTime(String time) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

public class Main {
    public static Timestamp toTimestampFromTime(String time) {

        try {//from   w w  w.j a  v  a 2  s.  co  m
            return toTimestampFromTime(Long.parseLong(time));
        } catch (Exception iae) {
            return null;
        }
    }

    public static Timestamp toTimestampFromTime(long time) {
        return new Timestamp(time);
    }
}

Related

  1. toTimestamp2(long seconds, int nanos)
  2. toTimestamp2(long value, int nanos, int meta)
  3. toTimestampByHour(Date date, int hour)
  4. toTimestampFromGMT(int yy, int mm, int dd, int hh, int mi, int ss)
  5. toTimestampFromLong(long millis)