|
|
@ -248,6 +248,22 @@ public class DateUtils { |
|
|
|
String currentDate = format.format(date); |
|
|
|
return currentDate; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上年字符串yyyy |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static String getLastYear() { |
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy"); |
|
|
|
Calendar c = Calendar.getInstance(Locale.CHINA); |
|
|
|
c.setTime(new Date()); |
|
|
|
c.add(Calendar.YEAR, -1);//拨回去年
|
|
|
|
Date date = c.getTime(); |
|
|
|
String currentDate = format.format(date); |
|
|
|
return currentDate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取当天剩余秒数 |
|
|
|
* @return |
|
|
|