Java Timestamp safeTimestamp(Date value)

Here you can find the source of safeTimestamp(Date value)

Description

safe Timestamp

License

Apache License

Declaration

public static Timestamp safeTimestamp(Date value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

import java.util.Date;

public class Main {
    public static Timestamp safeTimestamp(Date value) {
        return value != null ? new Timestamp(value.getTime()) : null;
    }//from ww  w  .j a v  a 2s . c o m
}

Related

  1. readTimestamp(ObjectInput in, long nullFlag)
  2. removeTime(Timestamp ts)
  3. resetHourMinuteSecond(Timestamp timestamp, int hour, int minute, int second)
  4. roundToHour(Timestamp arg)
  5. roundToSecond(Timestamp t)
  6. setTimestamp(byte[] ba, int offset, Timestamp val)
  7. setTimestamp(int index, Timestamp t, PreparedStatement stmt)
  8. setTimestampOrNull(PreparedStatement pstmt, int paramIndex, Timestamp value)
  9. sqlDate(Timestamp t)