package com.lutao.cloud.consume.util;

import java.time.Duration;
import java.time.LocalDateTime;

public class TimeUtil {

    /**
     * 获取时间差
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return {@link Integer }
     */
    public static Long getTimeDifference(LocalDateTime startTime, LocalDateTime endTime) {
        // 计算两个日期时间之间的差值
        Duration duration = Duration.between(startTime, endTime);
        // 将差值转换为分钟数
        long minutes = duration.toMinutes();
        return minutes / 10;
    }
}
