/**
* 获取当前日期、获取年、月、日 判断加0
*/
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Integer year=cal.get(Calendar.YEAR);//获取年
Integer month = cal.get(Calendar.MONTH)+1;//获取月(月份从0开始,如果按照中国的习惯,需要加一)
Integer day_moneth=cal.get(Calendar.DAY_OF_MONTH);//获取日(月中的某一天)
/**
* 获取上一年第一天的时间 返回yyyy-MM-dd
*
* @param enDate
* @return
*/
public Date getPreviousYearFirst(Date enDate) {
Date date = enDate;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy");// 可以方便地修改日期格式
String years = dateFormat.format(date);//得到年
int years_value = Integer.parseInt(years);
String fristStr = ye