Here you can find the source of convertZeroHourDate(Date source)
public static Date convertZeroHourDate(Date source)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date convertZeroHourDate(Date source) { Calendar cal = Calendar.getInstance(); cal.setTime(source);//from w w w . j av a2 s . c o m cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } }