java8 LocalDateTime获取某一天的起始时间戳范围
原创 hiJerry 发表于:2020-10-14 10:38:21
  阅读 :1414   收藏   编辑

LocalDate startDate = LocalDate.now();

// +8是北京时间
Long minTime = LocalDateTime.of(startDate, LocalTime.MIN).toInstant(ZoneOffset.of("+8")).toEpochMilli();
Long maxTime = LocalDateTime.of(startDate, LocalTime.MAX).toInstant(ZoneOffset.of("+8")).toEpochMilli();


System.out.println(minTime);
System.out.println(maxTime);