Java Calendar Hour setCalendar(int hour, int mins)

Here you can find the source of setCalendar(int hour, int mins)

Description

set Calendar

License

Open Source License

Parameter

Parameter Description
hour a parameter
mins a parameter

Declaration

public static Calendar setCalendar(int hour, int mins) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    /**/*  w  w w  .  jav a 2  s. com*/
     * @param hour
     * @param mins
     */
    public static Calendar setCalendar(int hour, int mins) {
        return setCalendar(hour, mins, 0);
    }

    /**
     * @param hour
     * @param mins
     * @param seco
     */
    public static Calendar setCalendar(int hour, int mins, int seco) {
        Calendar c = Calendar.getInstance();
        c.set(Calendar.HOUR_OF_DAY, hour);
        c.set(Calendar.MINUTE, mins);
        c.set(Calendar.SECOND, seco);
        return c;
    }

    /**
     * @param day
     * @param hour
     * @param mins
     * @param seco
     */
    public static Calendar setCalendar(int day, int hour, int mins, int seco) {
        Calendar c = setCalendar(hour, mins, seco);
        c.set(Calendar.DAY_OF_MONTH, day);
        return c;
    }

    /**
     * @param mont
     * @param day
     * @param hour
     * @param mins
     * @param seco
     */
    public static Calendar setCalendar(int mont, int day, int hour, int mins, int seco) {
        Calendar c = setCalendar(day, hour, mins, seco);
        c.set(Calendar.DAY_OF_MONTH, day);
        return c;
    }
}

Related

  1. hoursInDay(Calendar cal)
  2. moveHoursHand(int aNumberOfHours, Calendar aCalendar)
  3. moveToCalendarHourJust(Calendar cal)
  4. moveToCalendarHourTerminal(Calendar cal)
  5. sameHour(Calendar one, Calendar two)
  6. setDateToZeroHour(Calendar calendar)
  7. setHourMinSecAsNull(Calendar calendar)
  8. setHours(int i, Calendar calendar)
  9. setMinHour(Calendar gc)