Here you can find the source of getDaysByMonth(int month)
public static int getDaysByMonth(int month)
//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; } }