Java Day in Month getMonthDay(int year, int month)

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

Description

get Month Day

License

Apache License

Declaration

public static int getMonthDay(int year, int month) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int getMonthDay(int year, int month) {
        return getMonthDayByYear(year)[(--month)];
    }/* ww  w . jav a 2s . co m*/

    public static int[] getMonthDayByYear(int year) {
        int[] monthDay = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
            monthDay[1] += 1;
        return monthDay;
    }
}

Related

  1. getLastDayInMonth(int month, int year)
  2. getLastDayOfMonth(int year, int month)
  3. getLastDayOfMonth(String monthInitials)
  4. getMaxDayByMonth(String month)
  5. getMaxMonthDay(int year, int month)
  6. getMonthDayFormats()
  7. getMonthDays(int year, int month)
  8. getMonthDaysArray(int year)
  9. getMonthDayString(long l, boolean timezone, boolean formated)