Java Calendar Create getCalendar(int year, int month, int day)

Here you can find the source of getCalendar(int year, int month, int day)

Description

Create a calendar object for the given parameters.

License

Open Source License

Parameter

Parameter Description
year The calendar year.
month The calendar month (actual month number, not the Java month index).
day The calendar day.

Return

The calendar object for the given parameters.

Declaration

private static Calendar getCalendar(int year, int month, int day) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    /**//w w  w .  java2s. c  o m
     * Create a calendar object for the given parameters.
     * 
     * @param year The calendar year.
     * @param month The calendar month (actual month number, not the Java month index).
     * @param day The calendar day.
     * @return The calendar object for the given parameters.
     */
    private static Calendar getCalendar(int year, int month, int day) {
        Calendar calendar = Calendar.getInstance();
        calendar.clear();
        calendar.set(year, month - 1, day);
        return calendar;
    }
}

Related

  1. getCalendar(final String isodate)
  2. getCalendar(int d, int m, int y)
  3. getCalendar(int dayOfWeek, int atHour, int atMinute)
  4. getCalendar(int year, int month, int date)
  5. getCalendar(int year, int month, int day)
  6. getCalendar(int year, int month, int day, int hour, int min, int sec, String timezone)
  7. getCalendar(int year, int month, int day, int hour, int mins, int secs)
  8. getCalendar(int year, int month, int day, int hours, int minutes, int seconds, TimeZone tz)
  9. getCalendar(int year, int month, int day, TimeZone timeZone)