Here you can find the source of endOfDay(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static Date endOfDay(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**//from w w w . ja va 2s . c o m * * Sets the time field of given date to 24:00:00:00. Date field rolls 1 day * up. * * @param date * @return */ public static Date endOfDay(Date date) { GregorianCalendar endOfDay = new GregorianCalendar(); endOfDay.setTime(date); // 24 saat seklindeki saat set ediliyor endOfDay.set(Calendar.HOUR_OF_DAY, 24); endOfDay.set(Calendar.SECOND, 0); endOfDay.set(Calendar.MINUTE, 0); endOfDay.set(Calendar.MILLISECOND, 0); // System.out.println(endOfDay.getTime()); return endOfDay.getTime(); } }