Here you can find the source of getSqlDate(java.util.Date utilDate)
Parameter | Description |
---|---|
utilDate | java.util.Date |
public static java.sql.Date getSqlDate(java.util.Date utilDate)
//package com.java2s; /******************************************************************************* * Copyright Duke Comprehensive Cancer Center and SemanticBits * /* w ww . j ava2 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.Date * * @param utilDate * java.util.Date * @return sqlDate java.sql.Date */ public static java.sql.Date getSqlDate(java.util.Date utilDate) { return new java.sql.Date(utilDate.getTime()); } public static Time getTime(Date date) { return new Time(date.getTime()); } }