JAVA8 中 LocalDateTime的使用小栗子

        LocalDate givenDate = LocalDate.parse("2019-04-23",DateTimeFormatter.ofPattern("yyyy-MM-dd"));

        LocalDateTime startOfDay = givenDate.atTime(0,0,1);
LocalDateTime endOfDay = givenDate.atTime(23,59,59);
System.out.println(givenDate);
System.out.println(givenDate.plusDays(1)); System.out.println(startOfDay);
System.out.println(endOfDay); Date fromDate = Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
Date toDate = Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant()); System.out.println(fromDate);
System.out.println(toDate);
上一篇:springMVC中 @RequestParam和@RequestBody的区别


下一篇:Transform-style和Perspective属性