Java 获取最近时间

public static String getStatetime() throws ParseException{

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, - 7);
Date monday = c.getTime();
String preMonday = sdf.format(monday);
return preMonday;
}

来自:http://blog.sina.com.cn/s/blog_48fd85de0100gphn.html

原文地址:https://www.cnblogs.com/lanliying/p/5265455.html