Here you can find the source of getTimestamp(java.util.Date utilDate)
Parameter | Description |
---|---|
utilDate | java.util.Date |
public static java.sql.Timestamp getTimestamp(java.util.Date utilDate)
//package com.java2s; /******************************************************************************* * Copyright Duke Comprehensive Cancer Center and SemanticBits * /* ww w .j a v a 2 s. c o m*/ * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/c3pr/LICENSE.txt for details. ******************************************************************************/ import java.sql.Time; import java.util.Date; public class Main { /** * converts a java.util.Date to java.sql.Timestamp * * @param utilDate * java.util.Date * @return sqlTimestamp java.sql.Timestamp */ public static java.sql.Timestamp getTimestamp(java.util.Date utilDate) { return new java.sql.Timestamp(utilDate.getTime()); } public static Time getTime(Date date) { return new Time(date.getTime()); } }