Nov 10, 2018

java.sql.Date example

java.sql.Date contains only information about the date part (year, month, day).  Here is an example to use java.sql.Date

Calendar calendar = Calendar.getInstance();
//calendar.set(Calendar.HOUR_OF_DAY, 0);
//calendar.set(Calendar.MINUTE, 0);
//calendar.set(Calendar.SECOND, 0);
//calendar.set(Calendar.MILLISECOND, 0);
Date date = new Date(calendar.getTime().getTime());