package com.foc.util;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

/**
 * @author lisu
 */
public class DateUtils {
    /**
     * 计算当前日期与{@code endDate}的间隔天数
     *
     * @param time
     * @return 间隔分钟
     */
    public static long until(LocalDateTime time) {
        return Math.abs(LocalDateTime.now().until(time, ChronoUnit.MINUTES));
    }
}
