Java Calendar Month intToCalendarMonth(int month)

Here you can find the source of intToCalendarMonth(int month)

Description

int To Calendar Month

License

Open Source License

Declaration

private static int intToCalendarMonth(int month) 

Method Source Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    private static int intToCalendarMonth(int month) {
        if (month == 1) {
            return Calendar.JANUARY;
        } else if (month == 2) {
            return Calendar.FEBRUARY;
        } else if (month == 3) {
            return Calendar.MARCH;
        } else if (month == 4) {
            return Calendar.APRIL;
        } else if (month == 5) {
            return Calendar.MAY;
        } else if (month == 6) {
            return Calendar.JUNE;
        } else if (month == 7) {
            return Calendar.JULY;
        } else if (month == 8) {
            return Calendar.AUGUST;
        } else if (month == 9) {
            return Calendar.SEPTEMBER;
        } else if (month == 10) {
            return Calendar.OCTOBER;
        } else if (month == 11) {
            return Calendar.NOVEMBER;
        } else if (month == 12) {
            return Calendar.DECEMBER;
        } else {/*from w w  w .j a v a 2s . c  o m*/
            return Calendar.JANUARY;
        }
    }
}

Related

  1. getNextMonth(Calendar calendar, int month)
  2. getNumDaysInMonth(GregorianCalendar aCalendar)
  3. getStartOfMonth(Date day, Calendar cal)
  4. incrementMonth(Calendar cal)
  5. incrementMonthByVal(Calendar theCal, int val)
  6. isFirstDayOfMonth(Calendar calendar)
  7. lastDayOfMonth(Calendar c)
  8. month(Calendar calendar)
  9. month(Calendar date)