intervalTime.js 306 字节 原文件 审查 历史 永久链接 1 2 3 4 5 6 7 //计算两个时间之间的时间差 多少天时分秒 export function intervalTime(timestamp1, timestamp2) { // 将时间戳转换为毫秒 const diffInMilliseconds = Math.abs(timestamp2 - timestamp1); // 1 小时等于 3600000 毫秒 return (diffInMilliseconds / 3600000).toFixed(2) + '时'; }