Here you can find the source of convertDateFromUtilToSql(java.util.Date utilDate)
static java.sql.Date convertDateFromUtilToSql(java.util.Date utilDate)
//package com.java2s; public class Main { static java.sql.Date convertDateFromUtilToSql(java.util.Date utilDate) { java.sql.Date sqlDate = null; if (utilDate != null) { Calendar cal = Calendar.getInstance(); cal.setTime(utilDate);/*from w w w .j a v a 2 s.c om*/ cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); sqlDate = new java.sql.Date(cal.getTimeInMillis()); } return sqlDate; } }