Java Calendar Year calendarFor(final int year, final int month, final int day, final int hour, final int minute)

Here you can find the source of calendarFor(final int year, final int month, final int day, final int hour, final int minute)

Description

calendar For

License

Open Source License

Declaration

public static Calendar calendarFor(final int year, final int month, final int day, final int hour,
            final int minute) 

Method Source Code


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

public class Main {
    public static Calendar calendarFor(final int year, final int month, final int day, final int hour,
            final int minute) {

        final Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, month - 1);
        cal.set(Calendar.DAY_OF_MONTH, day);
        cal.set(Calendar.HOUR_OF_DAY, hour);
        cal.set(Calendar.MINUTE, minute);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal;

    }//from www  .  j  a  v a 2 s. c  o m
}

Related

  1. calendar(int year, int month, int date, int hourOfDay, int minute)
  2. calendarFor(int day, int month, int year)
  3. calendarOf(int year, int month, int day, int hour, int minute, int second, int millis)
  4. copyYearMonthDay(Calendar destCal, Calendar sourceCal)
  5. createAndValidateCalendar(int month, int day, int year)