Here you can find the source of setMidnight(Calendar date)
Parameter | Description |
---|---|
date | The Calendar object to be set to midnight |
@Deprecated public static Calendar setMidnight(Calendar date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { /**// ww w .j a v a 2s . c o m * Set the time of a {@link Calendar} object to midnight by truncation. * This returns a new object - the original remains untouched. * * @param date The {@link Calendar} object to be set to midnight * @return A copy of the {@link Calendar} object with the time set to midnight */ @Deprecated public static Calendar setMidnight(Calendar date) { Calendar result = (Calendar) date.clone(); result.set(Calendar.HOUR_OF_DAY, 0); result.set(Calendar.MINUTE, 0); result.set(Calendar.SECOND, 0); result.set(Calendar.MILLISECOND, 0); return result; } }