Here you can find the source of getCountDayForMonth(int year, int month)
public static int getCountDayForMonth(int year, int month)
//package com.java2s; //License from project: Apache License public class Main { public static int getCountDayForMonth(int year, int month) { if (month > 12) return 0; int[] monDays = new int[] { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (((year) % 4 == 0 && (year) % 100 != 0) || (year) % 400 == 0) monDays[2]++;/*from w w w . ja v a 2 s. c o m*/ return monDays[month]; } }