Java Calendar Minute calendarTodayOf(int hour, int minute, int second, int millis)

Here you can find the source of calendarTodayOf(int hour, int minute, int second, int millis)

Description

calendar Today Of

Declaration

public static Calendar calendarTodayOf(int hour, int minute, int second, int millis) 

Method Source Code


//package com.java2s;
import java.util.Calendar;

public class Main {

    public static Calendar calendarTodayOf(int hour, int minute, int second, int millis) {
        Calendar calendar = Calendar.getInstance();
        return setCalendarTime(calendar, hour, minute, second, millis);
    }/*from  w  w  w.j a va2s . com*/

    public static Calendar calendarTodayOf(int hour, int minute, int second) {
        return calendarTodayOf(hour, minute, second, 0);
    }

    public static Calendar calendarTodayOf(int hour, int minute) {
        return calendarTodayOf(hour, minute, 0, 0);
    }

    public static Calendar setCalendarTime(Calendar calendar, int hour, int minute, int second, int millis) {
        calendar.set(Calendar.HOUR_OF_DAY, hour);
        calendar.set(Calendar.MINUTE, minute);
        calendar.set(Calendar.SECOND, second);
        calendar.set(Calendar.MILLISECOND, millis);
        return calendar;
    }
}

Related

  1. clearHoursMinutesSecondsMillis(Calendar calendar)
  2. getFirstMinuteOfDay(Calendar dt)
  3. getMinute(Calendar cal)
  4. getMinutes(Calendar cal)