标签:div return calendar array public 日期 import ring for
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
//本月所有日期
private List getDayListOfMonth() { List list = new ArrayList(); Calendar aCalendar = Calendar.getInstance(Locale.CHINA); int year = aCalendar.get(Calendar.YEAR);//年份 int month = aCalendar.get(Calendar.MONTH) + 1;//月份 int day = aCalendar.getActualMaximum(Calendar.DATE); for (int i = 1; i <= day; i++) { String aDate = String.valueOf(year)+"-"+month+"-"+i; list.add(aDate); } return list; }
//本月天数
public int getDayOfMonth(){ Calendar aCalendar = Calendar.getInstance(Locale.CHINA); int day=aCalendar.getActualMaximum(Calendar.DATE); return day; }
标签:div return calendar array public 日期 import ring for
原文地址:https://www.cnblogs.com/lxnv587/p/8983272.html