Here you can find the source of getDateWithoutTime(final Calendar calendar)
public static Date getDateWithoutTime(final Calendar calendar)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static final long SECOND = TimeUnit.SECONDS.toMillis(1); public static final long MINUTE = TimeUnit.MINUTES.toMillis(1); public static Date getDateWithoutTime(final Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); }/*from ww w . ja v a2 s . c om*/ }