获取前day天的凌晨0点的秒值
Params: day – 0表示当天
public static long getZeroSecondByTimeBeforeDay(int day) {
return LocalDateTime.of(LocalDate.now().minusDays(day), LocalTime.MIN).toInstant(ZoneOffset.of("+8")).getEpochSecond();
}
获取当月一号凌晨0点的秒值
public static long getCurrentMonthZeroSecond() {
return LocalDateTime.now().withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0).toInstant(ZoneOffset.of("+8")).getEpochSecond();
}