Here you can find the source of getStartOfDay(Calendar cal)
public static Calendar getStartOfDay(Calendar cal)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static Calendar getStartOfDay(Calendar cal) { Calendar ret = Calendar.getInstance(); ret.setTime(cal.getTime());/*from w w w . j a v a 2 s. com*/ ret.set(11, 0); ret.set(12, 0); ret.set(13, 0); ret.set(14, 0); return ret; } }