Java Calendar Hour toMinHours(Calendar calendar)

Here you can find the source of toMinHours(Calendar calendar)

Description

This method sets the calendar argument to the the zero hours of the day

License

Open Source License

Parameter

Parameter Description
calendar a given parameter

Declaration

public static void toMinHours(Calendar calendar) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {
    /**/*from  www . j  a  va2s .  c o m*/
     * This method sets the calendar argument to the the zero hours of the day
     *
     * @param calendar a given parameter
     */
    public static void toMinHours(Calendar calendar) {
        if (calendar != null) {
            calendar.set(Calendar.HOUR_OF_DAY, 0);
            calendar.set(Calendar.MINUTE, 0);
            calendar.set(Calendar.SECOND, 0);
            calendar.set(Calendar.MILLISECOND, 0);
        }
    }
}

Related

  1. setCalendar(int hour, int mins)
  2. setDateToZeroHour(Calendar calendar)
  3. setHourMinSecAsNull(Calendar calendar)
  4. setHours(int i, Calendar calendar)
  5. setMinHour(Calendar gc)
  6. truncateHour(Calendar c)
  7. truncateToHour(Calendar cal)