package com.zanxiang.game.back.serve.utils;

import com.zanxiang.module.util.DateUtil;

import java.time.LocalDateTime;

public class OrderUtil {

    public static String regPayIntervalTime(LocalDateTime payTime, LocalDateTime regTime) {
        if (payTime == null || regTime == null) {
            return "--";
        }
        // 间隔分钟数
        long intervalMinute = (DateUtil.localDateTimeToSecond(payTime) - DateUtil.localDateTimeToSecond(regTime)) / 60;
        long hour = intervalMinute / 60;
        if (intervalMinute % 60 > 0) {
            return hour + "小时" + (intervalMinute % 60) + "分";
        } else {
            return hour + "小时";
        }
    }
}
