Calendar的getActualMaximum(int field)根据你传入的参数代表的意思(年、月、周等)查询当前(年、月、周)拥有的最大值。 如果是年就查询这一年中的天数,如果月份就查询当前月中的天数,如果是周就查询当前周的天数 这个int类型在Calendar中是一个常量定义的,他们分别是public static final int ERA = 0;
public static final int YEAR = 1; public static final int MONTH = 2; public static final int WEEK_OF_YEAR = 3; public static final int WEEK_OF_MONTH = 4; public static final int DATE = 5; public static final int DAY_OF_MONTH = 5; public static final int DAY_OF_YEAR = 6; public static final int DAY_OF_WEEK = 7;
记录备份