public static Date zeroTimeDate(Date date){
  final GregorianCalendar gregorianCalendar=new GregorianCalendar();
  gregorianCalendar.setTime(date);
  gregorianCalendar.set(Calendar.HOUR_OF_DAY,0);
  gregorianCalendar.set(Calendar.MINUTE,0);
  gregorianCalendar.set(Calendar.SECOND,0);
  gregorianCalendar.set(Calendar.MILLISECOND,0);
  return gregorianCalendar.getTime();
}

public static Date zeroTimeDate ( Date date ) { final GregorianCalendar gregorianCalendar = new GregorianCalendar ( ) ; gregorianCalendar . setTime ( date ) ; gregorianCalendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; gregorianCalendar . set ( Calendar . MINUTE , 0 ) ; gregorianCalendar . set ( Calendar . SECOND , 0 ) ; gregorianCalendar . set ( Calendar . MILLISECOND , 0 ) ; return gregorianCalendar . getTime ( ) ; }
reset the time of a date
