Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getStartOfDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTime(); } }