Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static Calendar toBeginningOfDay(Calendar day) { day.set(Calendar.HOUR_OF_DAY, 0); day.set(Calendar.MINUTE, 0); day.set(Calendar.SECOND, 0); day.set(Calendar.MILLISECOND, 0); return day; } }