borrowTiming(start, end) {
return (start, end) => {
start = dayjs(start);
end = dayjs(end);
let time = end.diff(start);
//计算出相差天数
var days = Math.floor(time / (24 * 3600 * 1000));
//计算出小时数
var leave1 = time % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
var hours = Math.floor(leave1 / (3600 * 1000));
//计算相差分钟数
var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
var minutes = Math.floor(leave2 / (60 * 1000));
return `${days}天${hours}小时${minutes}分钟`;
}
标签:3600,end,间隔,start,计算,var,两个,1000
From: https://www.cnblogs.com/c0lmd0wn/p/18135765