SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date=new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DAY_OF_MONTH, -1); date = calendar.getTime(); System.out.println(sdf.format(date));
原创文章,作者:wure,如若转载,请注明出处:https://blog.ytso.com/273667.html