Here you can find the source of clearHourMinute(Date date)
public static Date clearHourMinute(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date clearHourMinute(Date date) { if (date == null) return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from ww w . j a va 2 s .co m*/ calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } }