/**
* 去年今天
* @return
*/
public static String getNowOfLastYear() {
// Date Format will be display
SimpleDateFormat aSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
GregorianCalendar aGregorianCalendar = new GregorianCalendar();
// Get last month GregorianCalendar object
aGregorianCalendar.set(Calendar.YEAR, aGregorianCalendar
.get(Calendar.YEAR) - 1);
// Format the date to get year and month
String currentYearAndMonth = aSimpleDateFormat
.format(aGregorianCalendar.getTime());
return currentYearAndMonth;
}
/**
* 上个月今天
* @return
*/
public static String getMonthDate() {
// Date Format will be display
SimpleDateFormat aSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
GregorianCalendar aGregorianCalendar = new GregorianCalendar();
// Get last month GregorianCalendar object
aGregorianCalendar.set(Calendar.MONTH, aGregorianCalendar
.get(Calendar.MONTH) - 1);
// Format the date to get year and month
String currentYearAndMonth = aSimpleDateFormat
.format(aGregorianCalendar.getTime());
return currentYearAndMonth;
}