Here you can find the source of days(int month, int year)
public static int days(int month, int year)
//package com.java2s; // http://www.gnu.org/licenses/lgpl-3.0-standalone.html public class Main { public static int days(int month, int year) { if (month == 2) return 28 + ((year % 4 == 0) ? 1 : 0) - ((year % 4 == 100) ? 1 : 0); if (month < 8) return 30 + (month % 2); return 31 - (month % 2); }//from www.j av a 2 s . c o m }