Here you can find the source of getZeroTimeDate(Date fecha)
public static Date getZeroTimeDate(Date fecha)
//package com.java2s; import java.sql.Date; import java.util.Calendar; public class Main { public static Date getZeroTimeDate(Date fecha) { Date res = fecha;//from ww w . j av a 2 s . c om Calendar calendar = Calendar.getInstance(); calendar.setTime(fecha); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); res = new Date(calendar.getTime().getTime()); return res; } }