Here you can find the source of getMonthMaxDate(String str)
public static String getMonthMaxDate(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String getMonthMaxDate(String str) { int month = Integer.parseInt(str.substring(5)); switch (month) { case 1:/* w ww . j av a 2 s . c om*/ 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: int year = Integer.parseInt(str.substring(0, 3)); if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return "29"; else return "28"; } return "0"; } }