Here you can find the source of startOfDay(Date value)
Parameter | Description |
---|---|
value | Specified time |
public static Date startOfDay(Date value)
//package com.java2s; //License from project: LGPL import java.util.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /**/*from w w w .j a va 2 s . c o m*/ * Return the start of a day containing a specified time * @param value Specified time * @return Start of day */ public static Date startOfDay(Date value) { Calendar working = new GregorianCalendar(); working.setTime(value); working.set(Calendar.HOUR_OF_DAY, 0); working.set(Calendar.MINUTE, 0); working.set(Calendar.SECOND, 0); working.set(Calendar.MILLISECOND, 0); return working.getTime(); } }