Java Day in Month getMaxDayByMonth(String month)

Here you can find the source of getMaxDayByMonth(String month)

Description

get Max Day By Month

License

Apache License

Declaration

public static int getMaxDayByMonth(String month) 

Method Source Code

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

public class Main {

    public static int getMaxDayByMonth(String month) {
        switch (Integer.parseInt(month)) {
        case 1://from   ww  w  .  j  a  v a 2 s.c o  m
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            return 31;
        case 4:
        case 6:
        case 9:
        case 11:
            return 30;
        case 2:
            return 29;
        default:
            return 30;
        }
    }
}

Related

  1. getFirstDayOfMonth(int year, int month)
  2. getFirstdayOfMonth(String year, String month)
  3. getLastDayInMonth(int month, int year)
  4. getLastDayOfMonth(int year, int month)
  5. getLastDayOfMonth(String monthInitials)
  6. getMaxMonthDay(int year, int month)
  7. getMonthDay(int year, int month)
  8. getMonthDayFormats()
  9. getMonthDays(int year, int month)