package com.jjt.rziot;

import com.jjt.utils.Tools;
import javafx.util.Pair;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * TimeUtils$
 *
 * @author wukai
 * @date 2025/5/19 16:44
 */
public class TimeUtils {
    public static Pair<Long, Long> time() {
        LocalDateTime ldt = Tools.currWholeTime();
        //上一个小时
        ldt = ldt.minusHours(1);
        //开始时间需要向前取一秒
        LocalDateTime start = ldt.minusSeconds(1);
        LocalDateTime end = ldt.plusHours(1);
        Long startTime = start.toInstant(ZoneOffset.of("+8")).toEpochMilli();
        Long endTime = end.toInstant(ZoneOffset.of("+8")).toEpochMilli();
        return new Pair<>(startTime, endTime);
    }
}
