Here you can find the source of dateStart(final Calendar c)
public static Calendar dateStart(final Calendar c)
//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 Calendar dateStart(final Calendar c) { c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); return c; }//from w w w . j av a 2 s . c o m public static long dateStart(final Date date) { final Calendar c = Calendar.getInstance(); c.setTime(date); c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); return c.getTimeInMillis(); } }