标签:i++ for time() tar size int orm imp str
private String[] getDateArrByWeek(Date startDate, Date endDate) {
Calendar c = Calendar.getInstance();
List<String> list = new ArrayList<String>();
SimpleDateFormat df = new SimpleDateFormat("YYYY年MM月dd日");
for (; startDate.getTime() <= endDate.getTime();) {
String _startDate = df.format(startDate);
c.setTime(startDate);
c.add(Calendar.WEEK_OF_MONTH, 1);
startDate = c.getTime();
String _endDate = df.format(startDate);
c.setTime(startDate);
c.add(Calendar.DATE, -1);
_endDate = df.format(c.getTime());
list.add(_startDate+"-"+_endDate);
}
String[] ret = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
ret[i] = list.get(i);
}
return ret; }
标签:i++ for time() tar size int orm imp str
原文地址:http://www.cnblogs.com/cuijinlong/p/6322067.html