Here you can find the source of dateToTimestamp(Date date)
Parameter | Description |
---|---|
date | the date to convert. |
static Timestamp dateToTimestamp(Date date)
//package com.java2s; import java.sql.Timestamp; import java.util.Date; public class Main { /**//ww w .j ava 2 s .c o m * A Utility method to convert a Date instance to Timestamp instance. * * @param date * the date to convert. * @return the timestamp */ static Timestamp dateToTimestamp(Date date) { if (date == null) { date = new Date(); } return new Timestamp(date.getTime()); } }