Here you can find the source of setMidnight(Calendar cal)
public static void setMidnight(Calendar cal)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static void setMidnight(Calendar cal) { cal.set(Calendar.MILLISECOND, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.HOUR_OF_DAY, 0); }/*from ww w .j a v a 2 s . c om*/ }