特定年份的特定月份的天数?
如何知道特定年份的特定月份有多少天? String date = "2010-01-19"; String[] ymd = date.split("-"); int year = Integer.parseInt(ymd[0]); int month = Integer.parseInt(ymd[1]); int day = Integer.parseInt(ymd[2]); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR,year); calendar.set(Calendar.MONTH,month); int daysQty = calendar.getDaysNumber(); // Something like this