Calendar - 一周内

Calendar c = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String endtime = format.format(c.getTime());
c.add(Calendar.DAY_OF_YEAR, -7);
String starttime = format.format(c.getTime());
 

你可能感兴趣的:(C++,c,C#)