SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date nowDate = new Date();
System.out.print("当前日期" + sdf.format(nowDate));
System.out.println(" "+nowDate);
//5分钟化为毫秒
long fiveMinutes = 5 * 60 * 1000;
System.out.println(fiveMinutes);
nowDate.setTime(nowDate.getTime() - fiveMinutes);
String strTime = sdf.format(nowDate);
System.out.print("当前日期减去五分钟" + strTime);
System.out.println(" "+nowDate)



