/**
* 获取某年第一天日期
*
* @param year 年份
* @return Date
*/
public Date getYearFirst(int year)
{
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
Date currYearFirst = calendar.getTime();
return currYearFirst;
}
/**
* 获取某年最后一天日期
*
* @param year 年份
* @return Date
*/
public Date getYearLast(int year)
{
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
calendar.roll(Calendar.DAY_OF_YEAR, - 1);
Date currYearLast = calendar.getTime();
return currYearLast;
}