Java Timestamp Convert To timestampSqlToDate(Timestamp timestamp)

Here you can find the source of timestampSqlToDate(Timestamp timestamp)

Description

Creates new instance of java.util.Date based on timestamp.

License

Open Source License

Parameter

Parameter Description
timestamp a parameter

Declaration

public static Date timestampSqlToDate(Timestamp timestamp) 

Method Source Code


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

import java.sql.Timestamp;
import java.util.Date;

public class Main {
    /**/*from   ww  w .  j a  v a2s .c o m*/
     * Creates new instance of java.util.Date based on timestamp.
     *
     * @param timestamp
     * @return
     */
    public static Date timestampSqlToDate(Timestamp timestamp) {
        if (timestamp == null) {
            return null;
        }

        return new Date(timestamp.getTime());
    }
}

Related

  1. Timestamp2Arch(Timestamp ts)
  2. timestamp2Calendar(Timestamp ts)
  3. timestamp2Date(java.sql.Timestamp t)
  4. timestamp2Internal(java.sql.Timestamp t)
  5. timestamp2ToTimestamp(long seconds, int fraction, int width)
  6. TimestampToBigint(String timestamp)
  7. timeStampToBytes(Timestamp ts)
  8. timestampToCalendar(java.sql.Timestamp inTime)
  9. timestampToCalendar(Timestamp time)