【java基础】获取当前时间、日期,上一周、下一周等(待填坑)

LocalDate newYearsEve=LocalDate.of(1992,12,31)

Int year =newYearsEve.getYear();    //获取年

Int month=newYearsEve.getMonthValue();    //获取月

Int day=newYearsEve.getDayOfMonth();     //获取日

LocalDate aThousandDaysLater =newYearsEve.plusDays(1000); //1000天以后的日期

Year =aThousandDaysLater.getYear();  //2002

Month=aThousandDaysLater.getMonthValue(); //09

Day=aThousandDaysLater.getDayOfMonth();   //26




猜你喜欢

转载自blog.csdn.net/hutuyaoniexi/article/details/81040539