Here you can find the source of getDateStart(Date date)
public static Date getDateStart(Date date)
//package com.java2s; import java.util.*; public class Main { public static Date getDateStart(Date date) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, (date.getYear() + 1900)); calendar.set(Calendar.MONTH, date.getMonth()); calendar.set(Calendar.DATE, date.getDate()); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTime(); }//from www.j a va2s.c o m public String getDate() { java.sql.Date enter = new java.sql.Date(System.currentTimeMillis()); return enter.toString(); } public String getTime() { java.sql.Time ent = new java.sql.Time(System.currentTimeMillis()); return ent.toString(); } }