public static String subDate(Date date, int val) {// 1取得时间,以此类推
Calendar gc = new GregorianCalendar();
gc.setTime(date);
gc.add(Calendar.DATE, val);
//gc.add(Calendar.HOUR, -val);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
return sdf.format(gc.getTime());
}
阅读(522) | 评论(0) | 转发(0) |