Java常用日期操作

日期加一天操作

String today_date="2020-4-1";
SimpleDateFormat Date_Format = new SimpleDateFormat("yyyy-MM-dd");
Date today = Date_Format.parse(today_date);
Calendar calendar = Calendar.getInstance();
calendar.setTime(today);
calendar.add(Calendar.DAY_OF_MONTH, +1);
Date day1=calendar.getTime();
String Day1=Date_Format.format(day1);

 

posted @ 2020-04-01 15:10  mirage_mc  阅读(156)  评论(0编辑  收藏  举报