Here you can find the source of getMaxMonthDay(int year, int month)
public static int getMaxMonthDay(int year, int month)
//package com.java2s; //License from project: Apache License public class Main { public static int getMaxMonthDay(int year, int month) { if (month < 7) { return 31; // months 1..6 }/* ww w . j a v a 2s. c om*/ if (month < 12) { return 30; // months 7..11 } if (isJalaliLeapYear(year)) { return 30; // month 12, but leap year } return 29; // month 12 and not a leap year } public static boolean isJalaliLeapYear(int year) { int mod = (year + 11) % 33; if ((mod != 32) && ((mod % 4) == 0)) { return true; } else { return false; } } }