我想知道当前日期时间和年份的名称,并计算当月的天数
答案 0 :(得分:3)
int iYear = 2000;
int iMonth = Calendar.January;
int iDay = 1;
// Create a calendar object and set year and month
Calendar mycal = new GregorianCalendar(iYear, iMonth, iDay);
// Get the number of days in that month
int daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH);