tplink切片任务:切片时间还原为1小时(之前是测试1分钟)

This commit is contained in:
1378012178@qq.com 2026-05-13 13:58:08 +08:00
parent e770be5094
commit ccc41e1eba
1 changed files with 2 additions and 5 deletions

View File

@ -49,9 +49,7 @@ public class TplinkUploadJob implements Job {
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info("tplink切片上传定时任务执行时间{}", DateUtils.now());
//拿到前一小时的开始和结束时间
// LocalDateTime lastHour = LocalDateTime.now().minusHours(1);
//todo 把这里改一下
LocalDateTime lastHour = LocalDateTime.now().minusDays(2);
LocalDateTime lastHour = LocalDateTime.now().minusHours(1);
//开始时间
ZonedDateTime startTimeZone = lastHour.withMinute(0).withSecond(0).withNano(0)
.atZone(ZoneId.of("Asia/Shanghai"));
@ -59,8 +57,7 @@ public class TplinkUploadJob implements Job {
long startMillis = startTimeZone.toInstant().toEpochMilli();
//结束时间
//todo 把这里改一下
ZonedDateTime endTimeZone = lastHour.withMinute(1).withSecond(59).withNano(0)
ZonedDateTime endTimeZone = lastHour.withMinute(59).withSecond(59).withNano(0)
.atZone(ZoneId.of("Asia/Shanghai"));
Date endTime = Date.from(endTimeZone.toInstant());
long endMillis = endTimeZone.toInstant().toEpochMilli();