Here you can find the source of setTimeToMidnight(GregorianCalendar c)
Parameter | Description |
---|---|
c | the instance to modify |
public static void setTimeToMidnight(GregorianCalendar c)
//package com.java2s; /**//from w w w . j a v a 2s .c o m * Copyright (c) 2010 Martin Geisse * * This file is distributed under the terms of the MIT license. */ import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /** * Sets the time fields (24-hour, minute, second, millisecond) of the specified * {@link GregorianCalendar} instance to 0 so it subsequently represents midnight * of the same day as before. * @param c the instance to modify */ public static void setTimeToMidnight(GregorianCalendar c) { c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); } }