Java8 日期DateTimeFormatter LocalDateTime

 

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
        System.out.println(dtf.format(LocalDateTime.now()));
        System.out.println(dtf.format(LocalDateTime.now().plusDays(1)));
         
        System.out.println(LocalDateTime.now().getDayOfWeek().getValue());

 

posted @ 2020-06-22 11:17  kakaisgood  阅读(350)  评论(0编辑  收藏  举报