Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static java.util.Date getDateStart(java.util.Date d) { Calendar c = new GregorianCalendar(); c.clear(); Calendar co = new GregorianCalendar(); co.setTime(d); c.set(Calendar.DAY_OF_MONTH, co.get(Calendar.DAY_OF_MONTH)); c.set(Calendar.MONTH, co.get(Calendar.MONTH)); c.set(Calendar.YEAR, co.get(Calendar.YEAR)); // c.add(Calendar.DAY_OF_MONTH,1); // c.add(Calendar.MILLISECOND,-1); return c.getTime(); } }