Java Timestamp copyOrCreateTimestampNullsafe(Date date)

Here you can find the source of copyOrCreateTimestampNullsafe(Date date)

Description

copy Or Create Timestamp Nullsafe

License

Open Source License

Declaration

public static Timestamp copyOrCreateTimestampNullsafe(Date date) 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

import java.util.Date;

public class Main {
    public static Timestamp copyOrCreateTimestampNullsafe(Date date) {
        return date == null ? new Timestamp(System.currentTimeMillis()) : new Timestamp(date.getTime());
    }/*w  ww .j a  va 2  s  . c o m*/
}

Related

  1. changeDate(Timestamp date, Integer amount, Integer unit)
  2. checkTimestamp(String sval)
  3. clone(Timestamp original)
  4. concatDateAndTime(Timestamp date, Time time)
  5. convertTS2HHMM(Timestamp timeStamp)
  6. createDateTimestamp(java.util.Date date)
  7. date2Timestamp(Date date)
  8. date2Timestamp(Date value)
  9. dateAdd(Timestamp t1, Integer i, int type)