Java Calendar Time resetTime(GregorianCalendar cal)

Here you can find the source of resetTime(GregorianCalendar cal)

Description

Sets the time in the given cal to 00:00:00.000

License

Open Source License

Declaration

public static void resetTime(GregorianCalendar cal) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/* w ww  . j  a va2s.c o  m*/
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

import java.util.GregorianCalendar;
import java.util.Calendar;

public class Main {
    /**
     * Sets the time in the given <tt>cal</tt> to 00:00:00.000
     */
    public static void resetTime(GregorianCalendar cal) {
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
    }
}

Related

  1. removeTime(Calendar cal)
  2. removeTime(Calendar calendar)
  3. removeTime(final Calendar date)
  4. resetTime(Calendar cal)
  5. resetTime(Calendar cal)
  6. roundTime(double dt, Calendar tmp)
  7. sameTime(Calendar one, Calendar two)
  8. setDateTimeByString(Calendar theDateTime, String str)
  9. setTime(Calendar cal, int h, int m, int s, int ms)