Here you can find the source of copyOrCreateTimestampNullsafe(Date date)
public static Timestamp copyOrCreateTimestampNullsafe(Date date)
//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*/ }