Java Day in Month getDaysByMonth(int month)

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

Description

get Days By Month

License

Apache License

Declaration

public static int getDaysByMonth(int month) 

Method Source Code

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

public class Main {
    public static int getDaysByMonth(int month) {
        int day = 30;
        if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
            day = 31;//  ww w.j  ava2s  .  c o  m
        } else if (month == 2) {
            day = 28;
        }
        return day;
    }
}

Related

  1. getDayOfMonth(Object millis)
  2. GetDayOfMonth(String aDatetime)
  3. getDayOfMonth(String dateKey)
  4. getDayOfMonthSuffix(final int day)
  5. getDayOrMonth(int value)
  6. getDaysInMonth(int month, int year)
  7. getDaysInMonth(int month, int year)
  8. getDaysInMonth(int monthNum)
  9. getDaysInMonth(int year, int month)