Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.HOUR,
calendar.get(Calendar.HOUR) - 1);// 让日期加1
System.out.println(calendar.get(Calendar.DATE));// 加1之后的日期Top
System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS").format(calendar.getTime()));
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/17428.html